给定如下Python代码,用于计算1到正整数N的和:
N = int(input("请输入正整数:")) total = 0 for i in range(1, N + 1): total += i print(total)
正确
错误