题解 | #成绩排序#
成绩排序
https://www.nowcoder.com/practice/3f27a0a5a59643a8abf0140b9a8cf1f7
n = int(input())
stu = []
for i in range(n):
a, b = map(int, input().split(" "))
stu.append((a, b))
stu.sort(key=lambda x: (x[1], x[0]))#sort内置是可以用元组排序的
for x in stu:
print(x[0], end=" ")
print(x[1])
传音控股公司福利 360人发布