这是为了计算 1-20 的最小公倍数。
我似乎无法弄清楚为什么 while 循环不会结束。谁能帮我吗?
i = 1
j = 1
factors = 0
allfactor = False
while allfactor == False:
while j < 21:
if i % j == 0:
factors = factors + 1
j = j + 1
else:
break
if factors == 20:
allfactor = True
break
else:
i = i + 1
j = 1
factors = 0