본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 10974번모든 순열

by 현장 2022. 5. 17.

-Code

from itertools import permutations

n = int(input())
arr = [i for i in range(1, n + 1)]
for i in permutations(arr, n):
    print(*i)