alece
Sep 25, 2011 11:21 AM
this is how i did!! and it works too!!! but my professor doesnt want me to define a specific number like 5 i did in the program!!! and he doesnt want me to use the std library too!!!how can i make the user input any size of the number user wants!!!and he wants me to do using own algorithm and use swap and other methods!! help me if u can !!!
#include
#include
#include
#define s 5
using namespace std;
int main () {
cout >per[i];
}
int size = sizeof per/sizeof(int);
(per,per+size);
do {
for (int i=0; i<size; i++)
{
cout << per[i] << " ";
}
cout<<endl;
} while ( next_permutation (per,per+size) );
return 0;
}