n=n+1 放在print(s)的前/后的影响时间:2023-03-08 18:15:14 # 1+2+3+4+5+6+.....+100 = ? #关键在于,当n为时,才print(s) n = 1s = 0while n < 101: s = s + n if n ==100: #关键在于这一步, 我用if来判断,当n为100时,才print(s), 否则继续while循环 print(s) n = n + 1