1047.全排列
Status Time Memory Lang. Submit Date

1047.全排列

Time Limit:1000MS  Memory Limit:65535KB
Description

给定一个整数n,输出1-n的全排列。

Input

每个测试文件只有一个数据,输入一个整数n(0<n<8)。

Output

输出全排列(每个排列中的数字用空格隔开),且每组排列注意按字典序输出所有排列(即要先输出123才能输出132,而不能先输出132在输出123)。

Sample test
Sample input
3
Sample output
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
Note
Tags
Post editorial
Editorials
Login before submit
Test Input
Test Output
Console
IDE Setting
  • 字体设置
    调整适合你的字体大小。
  • 主题设置
    切换不同的代码编辑器主题,选择适合你的语法高亮。
  • 行宽限制
    设置每一行代码的最大字符个数,设置为0则不限制。