SWEA

[SWEA] 1966. 숫자를 정렬하자 (Python)

가은(JANE) 2024. 11. 5. 22:39

#Problem

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

#Think

  • sorted로 하면 런타임이 준다.
  • print(f"#{tc}", end = " ") 로 하면 뒤에거랑 이어서 출력할 수 있다
    • sep="-"로 하면 중간중간에 -를 넣어서 출력할 수 이다.

#Code

t = int(input())
for tc in range(1, t+1):
    n = int(input())
    num = sorted(list(map(int, input().split())))
    
    print(f"#{tc}", end=" ")
    print(*num)