求 1 - 100所有整数的和

1 i = 1
2 sum = 0
3 while i < 101:
4     sum = sum + i
5     i = i + 1
6 print(sum)

猜你喜欢

转载自www.cnblogs.com/lym1985/p/9670718.html