import sys
firstLine = True
secondLine = False
reverse = None
for line in sys.stdin:
if firstLine:
firstLine = False
secondLine = True
N = int(line)
students = list()
continue
if secondLine:
secondLine=False
reverse = (True if line.strip()=='0' else False)
continue
N -= 1
name,score = (line.split())
score = int(score)
students.append((name,score))
if N == 0:
firstLine = True
students.sort(reverse=reverse,key=lambda x:x[1])
for stu in students:
print(*stu)
KY2 成绩排序
最新推荐文章于 2024-07-19 16:36:18 发布