y = {}
x = []
print('输入quit表示选手成绩录入完毕')
while True:
name = input('输入选手名称: \n')
if name == 'quit':
break
score = float(input('请输入选手票数: \n'))
y[name] = score
items = y.items()
for i in items:
x.append([i[1], i[0]])
x.sort()
count = len(x) - 1
for k in range(1, len(x) + 1):
print(f'第{k}名:{x[count][1]}, 票数为{x[count][0]}票')
count -= 1
© 版权声明
THE END
暂无评论内容