2010年2月21日日曜日

project euler promblem5 python


2520 is the smallest number that can be divided by each of the numbers from 1 to 10 with What is the smallest number that is evenly divisible by all of the numbers from 1 to 20?

total = 0
for a in range(200000000,300000000):
    if a%3 == 0 and a%5 == 0 and a%4 == 0 and a%5 == 0 and a%6 == 0 and a%7 == 0 and a%8 == 0 and a%9 == 0 and a%10 == 0 and a%11 == 0 and a%12 ==0 and a%13 == 0 and a%14 == 0 and a%15 == 0 and a%16 == 0 and a%17 == 0 and a%18 == 0 and a% 19 == 0 and a%20 == 0:
        print a
    else :
        pass
~                   



0 件のコメント:

コメントを投稿