if __name__ == '__main__':
i = 1;
j = 1;
sum = 0;
while True:
next = i + j;
if next > 4000000 :
break;
if next % 2 == 0 :
sum += next;
i = j;
j = next;
print sum;
Project Euler 002 in Python
最新推荐文章于 2024-11-11 21:30:41 发布