for i in range方法 a=0 for i in range(1, 101): a+=i print(a) while方法 a=0 b=0 while b<100: b=b+1 a=a+b print("1到100之和",a)