Commit f15f684c by BellCodeEditor

save project

parent 5d549de5
Showing with 12 additions and 8 deletions
total = [] def getuints():
while True: total = []
while True:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q':
break
try: try:
unit = int(unit) unit = int(unit)
total.append(unit)
except Exception: except Exception:
print("请输入整数!") print("请输入整数!")
if unit== 'q': return total
break res = getuints()
else: print(res)
total.append(unit) num = sum(res)
print(total) print(num)
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment