文章
94
粉丝
0
获赞
19
访问
2.8k
n = int(input())
students = []
# 读取学生信息
for _ in range(n):
student_id, score = map(int, input().split())
students.append((student_id, score))
# 排序:先按成绩升序,成绩相同按学号升序
print(students)
students.sort(key=lambda x: (x[1], x[0]))
# 输出结果
for student in students:
print("%d %d"%(student[0],student[1]))
登录后发布评论
暂无评论,来抢沙发