Commit d66d6e54 by BellCodeEditor

save project

parent b97cc7fe
Showing with 6 additions and 5 deletions
...@@ -2,13 +2,13 @@ a = ["袁子皓",19,"小明",20,"小蓝",30,"小红",45,"小窝",56,"小猪",89, ...@@ -2,13 +2,13 @@ a = ["袁子皓",19,"小明",20,"小蓝",30,"小红",45,"小窝",56,"小猪",89,
name = input("请输入参赛者名字:") name = input("请输入参赛者名字:")
power = int(input("请输入臂力值:")) power = int(input("请输入臂力值:"))
for i in range(len(a)): for i in range(len(a)):
if i%2 == 1 and a[i] >= power: if power > a[-1]:
a.insert(i,power)
a.insert(i-1,name)
break
else:
a.append(name) a.append(name)
a.append(power) a.append(power)
break break
if i%2 == 1 and a[i] >= power:
a.insert(i-1,name)
a.insert(i,power)
break
b = a[-6:] b = a[-6:]
print(b) print(b)
\ 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