【递归】n个数的全排列

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

说明

从键盘读入n个整数(每个数都是1~9之间的数),输出这n个整数的全排列(数字不能重复)。

输入格式

1行输入一个整数n1<=n<=8

2行输入n个不相等的整数(1<=每个数<=9)。

输出格式

输出若干行,每行包括n个数据,表示一种排列方案,所有的排列按字典码从小到大排序输出

样例

3
2 4 6
2 4 6
2 6 4
4 2 6
4 6 2
6 2 4
6 4 2

第七届SWPU-ACM老生预选赛

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
187
Start at
2022-9-19 14:00
End at
2022-10-28 14:00
Duration
936 hour(s)
Host
Partic.
45