1659: 数字全排列(深度优先搜索)

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:23 Solved:8

Description

输入一个数字n(n>=10),对1~n进行全排列,输出所有的排列可能

Input

一行,数字n

Output

输出多行 每行显示1~n的排列

Sample Input Copy

3

Sample Output Copy

1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1