版权声明:。 https://blog.csdn.net/weixin_43778797/article/details/90243289
n = int(input("请输入要求累加到的数:")) sum = 0 for i in range(n+1): # 实际遍历到n sum += i print(sum)
版权声明:。 https://blog.csdn.net/weixin_43778797/article/details/90243289
n = int(input("请输入要求累加到的数:")) sum = 0 for i in range(n+1): # 实际遍历到n sum += i print(sum)