Pagini recente » Cod sursa (job #460521) | Cod sursa (job #2986618) | Diferente pentru junior-challenge intre reviziile 19 si 20 | Cod sursa (job #551873) | Cod sursa (job #3231549)
#include <bits/stdc++.h>
using namespace std;
int main() {
#ifdef INFOARENA
freopen ("permutari.in", "r", stdin);
freopen ("permutari.out", "w", stdout);
#endif
int n;
cin >> n;
vector<int> v(n);
iota(v.begin(), v.end(), 1);
do {
for (auto &x : v) {
cout << x << " ";
}
cout << "\n";
} while (next_permutation(v.begin(), v.end()));
return 0;
}