User: mhe33

  • Public profile

User profile: mhe33

User info
User name:mhe33
Name:me
Bio:# include <iostream>
using namespace std;

int count=0;
int functime=0;

void nmN(int a[],int m,int n,int size){
functime++;
while(m>0){
a[size-1]=m;
if(size==1){
for(int j=0;j<n;j++){
cout << a[j]<<" ";}
count++;
cout<<endl;
}
else{
nmN(a,m,n,size-1);
}
m--;
}
}


int main(){
int n;
cout <<"n: \n";
cin >> n;
int m;
cout << "m:\n";
cin>>m;
int * a=new int[n];
nmN(a,m,n,n);
cout << "Count: " << count << endl;
cout << "Function time: " << functime << endl;
system("pause");
return 0;
}








int count=0;
void printsub(int a[],int sizea,int n,int k){
if(k>n){return;}

while(n>0){
a[k-1]=n;
if(k==1){
for(int j=0;j<sizea;j++){
cout << a[j]<<" ";}
cout<<endl;
count++;
}
else{
printsub(a,sizea,n-1,k-1);
}
n--;
}
}
History
Joined:
Number of posts:4
Latest posts:

Problem functions
bn = 1 if n = 1 b(f) + b(c) + n if n ≥ 2, where • f means the floor of n • c means the c...

int * & a
What does this mean " bool function1(int * & a) " is it that address of a is a pointer to the integ...

Reading from FILES
This sounds good, I needed to do some parsing and detect errors so I actually ended up using this c...

Reading from FILES
char FILENAME[100]; ifstream SurveyFile; SurveyFile.open(FILENAME) while (!SurveyFile.eof) { ...

This user does not accept Private Messages