Commit ac3cee17 by BellCodeEditor

save project

parent 476a7e50
Showing with 13 additions and 11 deletions
# 古代测量臂力是靠不同重量的石锁,只能测整数哦。 hero=['赵一',1,'丁二',37,'孙五',52,'王猛',89,'周亮',100,"傻吧",102,'大倪',200]
# 最小的石锁是30公斤最大的石锁是100公斤,注意输入的数字哦。
# 请优化刚刚的代码,并增添交互效果,和自动输出最强三人信息的功能~
# 问询处
hero=['赵一',0.000000000000000000000001,'丁二',37,'孙五',52,'王猛',89,']
name=input("给爸输入参赛者名字:") name=input("给爸输入参赛者名字:")
for i in range(len(hero)): power = int(input("战力值:"))
for i in range (len(a)):
if power > a[-1]:
a.append(name)
a.append(power)
break
if i%2==1 and a[i]>=power:
a.insert(i-1,name)
a.insert(i,power)
break
b = a[-6:]
print(b)
......
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