Pagini recente » Cod sursa (job #459250) | Cod sursa (job #1119084) | Cod sursa (job #2984331) | Istoria paginii runda/ccex-2013-clasele-7-8/clasament | 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;
}