源程序:
num = int(input("input the number of end:"))sum1 = 0i = 1while i <= num: sum1 = sum1 + i i = i + 1print(sum)运行结果: