Pagini recente » Diferente pentru problema/pm2 intre reviziile 8 si 9 | Cod sursa (job #2173543) | Cod sursa (job #1463330) | Cod sursa (job #2184119) | Cod sursa (job #383466)
Cod sursa(job #383466)
#include <fstream>
#include <algorithm>
using namespace std;
ifstream in("permutari.in");
ofstream out("permutari.out");
int main () {
short myints[] = {1,2,3,4,5,6,7,8};
int y;
in>>y;
sort (myints,myints+y);
do {
for(short i=0;i<y;i++)
out<<myints[i]<<" ";
out<<endl;
} while ( next_permutation (myints,myints+y) );
return 0;
}