0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-08 11:58:48 +00:00
Baoshuo Ren 2021-06-30 19:10:43 +08:00 committed by Baoshuo Ren
parent 7390c1003d
commit 15534a7857
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

18
AcWing/842/842.cpp Normal file
View File

@ -0,0 +1,18 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, a[10];
cin >> n;
for (int i = 0; i < n; i++) {
a[i] = i + 1;
}
do {
for (int i = 0; i < n; i++) {
cout << a[i] << ' ';
}
cout << endl;
} while (next_permutation(a, a + n));
return 0;
}