import itertools
n=int(input())
array=[n for n in range(1,n+1)]
row = list(itertools.permutations(array))
for x in row:
for y in x:
print(’ ‘+str(y),end=’’)
print()
洛谷P1706 全排列问题
最新推荐文章于 2023-05-07 21:26:12 发布
import itertools
n=int(input())
array=[n for n in range(1,n+1)]
row = list(itertools.permutations(array))
for x in row:
for y in x:
print(’ ‘+str(y),end=’’)
print()