Pagini recente » Cod sursa (job #1554134) | Cod sursa (job #1393705) | Cod sursa (job #2580024) | Cod sursa (job #448625) | Cod sursa (job #2094272)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("permutari.in");
ofstream fout("permutari.out");
int number;
vector <int> permutations;
int main(){
fin >> number;
for ( int index = 1; index <= number; index++ )
permutations.push_back(index);
do{
for (auto element : permutations)
fout << element << " ";
fout << "\n";
}while(next_permutation(permutations.begin(), permutations.end()));
return 0;
}