Sie sind auf Seite 1von 1

#include<iostream.

h>
int n, s[20];
void afis(int n)
{ for(int i=1;i<=n;i++) cout<<s[i]<<" ";
cout<<endl;
}
void back(int k)
{ for(int i=s[k-1]+1;i<=n;i++)
{ s[k]=i;
afis(k);
back(k+1);
}
}
void main()
{ cin>>n;
back(1);
}

Das könnte Ihnen auch gefallen