【projecteuler.net】题目 5

来源:互联网 发布:文件分类整理软件 编辑:程序博客网 时间:2024/05/14 13:44

新博客地址:http://gorthon.sinaapp.com/

Problem 5

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?




>>> print 2520*11*13*17*19*2
232792560
>>> 

下面是看结果能不能被1到20整除:
>>> for i in range(2, 21):             if 232792560 % i != 0:                    print i                    break>>>

什么也没发生说明正确了。
原创粉丝点击