Pagini recente » Rating Banu Cristian (cbanu96) | Profil Brianna | Statisticile problemei Por Costel si Pinball | Cod sursa (job #3293491) | Cod sursa (job #3293889)
#include <fstream>
#include <algorithm>
using namespace std;
ifstream cin("ciur.in");
ofstream cout("ciur.out");
vector<int> v;
int main()
{
int n;
cin>>n;
for(int i = 1; i <= n; ++i)
v.push_back(i);
for (int i = 0; i < n; ++i)
cout << v[i] << ' ';
cout<<"\n";
while(next_permutation(v.begin(), v.end()))
{
for (int i = 0; i < n; ++i)
cout << v[i] << ' ';
cout << '\n';
}
return 0;
}