sum = 0 i = 1 while i<=100: sum = sum + i i += 1 print('1到100累积和:%d'% sum)登录后复制输出结果为5050登录后复制