백준

백준 10814번: 나이순 정렬 (파이썬)

inns21 2023. 7. 28. 10:41

n = int(input())
list = []
for i in range(n):
  age, name = input().split( )
  list.append((int(age), name))
list.sort(key=lambda x : x[0])

for x,y in list:
  print(x,y)