逻辑题【杭州多测师】【杭州多测师_王sir】

def func():
    '''逻辑题'''
    for i in range(1000):
        if i%7==0 and (i%2-1)==0 and (i%3-1)==0 and (i%4-1)==0 and (i%5-1)==0 and (i%6-1)==0:
            if i:
                print(i)  #先打印符合条件的、然后终止
                break
func() #至少有301个学生

运行结果如下:
至少有301个学生

  

原文地址:https://www.cnblogs.com/xiaoshubass/p/15117458.html