Commit a9210831 by BellCodeEditor

save project

parent c0fddc88
Showing with 21 additions and 0 deletions
k=input("请问你要输入的次数") #询问输入次数
people=[] #设置空列表
name=input("请输入你的名字")
power=input("请输入你的年龄")
people.append(name)
people.append(int(power))
print(people)
for a in range(int(k)-1): #设置重复执行次数
name=input("请输入你的名字")
power=input("请输入你的年龄")
for i in range(len(people)):
if i%2==1 and people[i]>=int(power):
people.insert(i-1,name)
people.insert(i,int(power))
break
print(people)
\ 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