Sa se genereze submultimile multimii {1,2,...,n}
#include<iostream>
using namespace std;
int n,x[10],nr=0;
void afisare(int n)
{for(int i=1;i<=n;i++)
cout<<x[i]<<" ";
cout<<endl;nr++;
}
void rec(int i)
{int j;
for(j=x[i-1]+1;j<=n;j++)
{x[i]=j;
afisare(i);
rec(i+1);}}
int main()
{cin>>n;rec(1);
cout<<nr<<" solutii";}