计算 1~100 的和 5050
while 循环:
i, s = 0, 0 while i < 101: s += i i += 1 print(s)
for 循环:
s = 0 for i in range(101): s += i print(s)
原文地址:https://www.cnblogs.com/shanger/p/12180784.html
时间: 2024-10-06 11:34:42
计算 1~100 的和 5050
while 循环:
i, s = 0, 0 while i < 101: s += i i += 1 print(s)
for 循环:
s = 0 for i in range(101): s += i print(s)
原文地址:https://www.cnblogs.com/shanger/p/12180784.html