0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-24 14:28:48 +00:00
OI-codes/AcWing/842/842.cpp

19 lines
325 B
C++
Raw Normal View History

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