1 a=0 2 for n in range(1,1000): 3 if n%3==0 or n%5==0: 4 a=a+n 5 print(a)
运行结果:
233168
原文地址:https://www.cnblogs.com/pangzx/p/9222191.html
时间: 2024-11-08 04:55:06
1 a=0 2 for n in range(1,1000): 3 if n%3==0 or n%5==0: 4 a=a+n 5 print(a)
运行结果:
233168
原文地址:https://www.cnblogs.com/pangzx/p/9222191.html