Pagini recente » Cod sursa (job #2334683) | Cod sursa (job #2870924) | Cod sursa (job #342812) | Statistici Milcu Amelia (Amelia_Milcu) | Cod sursa (job #382522)
Cod sursa(job #382522)
#include <fstream>
#include <algorithm>
using namespace std;
ifstream in("permutari.in");
ofstream out("permutari.out");
int main () {
int myints[] = {1,2,3,4,5,6,7,8};
int y;
in>>y;
sort (myints,myints+y);
do {
for(int i=0;i<y;i++)
out<<myints[i]<<" ";
out<<endl;
} while ( next_permutation (myints,myints+3) );
return 0;
}