0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-12 01:26:28 +00:00
OI-codes/Luogu/P1706/P1706.cpp

18 lines
335 B
C++
Raw Normal View History

2020-09-24 12:25:11 +00:00
// R38825486
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, a[11] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
scanf("%d", &n);
do {
2021-11-19 09:01:13 +00:00
for (int i = 0; i < n - 1; i++) {
2020-09-24 12:25:11 +00:00
printf("%5d", a[i]);
}
2021-11-19 09:01:13 +00:00
printf("%5d\n", a[n - 1]);
2020-09-24 12:25:11 +00:00
} while (next_permutation(a, a + n));
return 0;
}