1 比较判断
he = 0
i = -1
while he<=100:
i = int(input("请输入一个整数"))
he += i
print(he)
2 利用标志位
he = 0
i = -1
flag = True
while flag:
i = int(input("请输入一个整数"))
he += i
if he>100:
flag = false
print(he)
3 利用break
he = 0
i = -1
flag = True
while flag:
i = int(input("请输入一个整数"))
he += i
if he>100:
break
print(he)