0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-18 10:31:58 +00:00
OI-codes/AcWing/842/842.cpp

19 lines
325 B
C++

#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;
}