# ----------------------------------------------------for循环----------------------------------------------------- sum_even = 0 sum_odd = 0 sum_num = 0 for i in range(101): sum_num += i if i % 2: sum_odd += i else: sum_even += i print('1-100的和为:' + str(sum_num) + '
求1-100的和、偶数和、奇数和
最新推荐文章于 2024-05-31 15:38:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)