0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

P1706 全排列问题

R38825486
This commit is contained in:
Baoshuo Ren 2020-09-24 20:25:11 +08:00 committed by Baoshuo Ren
parent bda5800c92
commit 290b77dae3
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

17
problem/P1706/P1706.cpp Normal file
View File

@ -0,0 +1,17 @@
// 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 {
for (int i = 0; i < n-1; i++) {
printf("%5d", a[i]);
}
printf("%5d\n", a[n-1]);
} while (next_permutation(a, a + n));
return 0;
}