Problem 5

Problem 5

# Problem_5.py
"""
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
什么是能够整除(没有余数)从1到20之间的所有数字的最小正数字?
"""
for num in range(21, 99999999999):
    flag = True
    for i in range(1, 21):
        if not num % i == 0:
            flag = False
            break
    if flag:
        print(num)  # 232792560
        break

 

posted @ 2019-05-31 20:07  no樂on  阅读(143)  评论(0编辑  收藏  举报