Here is a program that calculates the sum of all even numbers from 0 to 10000:
sum =0
for i in range(0, 10001, 2):
sum += i
print("0-10000的偶数和为:", sum)
The answer is: 250050
Here is a program that calculates the sum of all even numbers from 0 to 10000:
sum =0
for i in range(0, 10001, 2):
sum += i
print("0-10000的偶数和为:", sum)
The answer is: 250050