Commit c0986f80 by BellCodeEditor

save project

parent a1863390
Showing with 3 additions and 3 deletions
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# 最小的石锁是30公斤最大的石锁是100公斤,注意输入的数字哦。 # 最小的石锁是30公斤最大的石锁是100公斤,注意输入的数字哦。
# 请优化刚刚的代码,并增添交互效果,和自动输出最强三人信息的功能~ # 请优化刚刚的代码,并增添交互效果,和自动输出最强三人信息的功能~
a=input("请输入你的姓名:") a=input("请输入你的姓名:")
b=input("请输入你的臂力:") b=int(input("请输入你的臂力:"))
# 问询处 # 问询处
...@@ -12,7 +12,7 @@ for i in range(len(hero)): ...@@ -12,7 +12,7 @@ for i in range(len(hero)):
if i%2==1 and hero[i]>=b: if i%2==1 and hero[i]>=b:
hero.insert(i-1,a) hero.insert(i-1,a)
hero.insert(i,b) hero.insert(i,b)
break break
print(hero[:-6]) print(hero[-6:])
# 打印出臂力最强的三个人和他们对应的臂力值: # 打印出臂力最强的三个人和他们对应的臂力值:
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