sum = 0 i = 1 while i<=100: sum = sum + i i += 1 print('1到100累积和:%d'% sum)登录后复制输出结果为5050登录后复制以上就是用while求1到100的和的详细内容,更多请关注Work网其它相关文章!