HI , everyone can you please write a program for me , I have a set with 5 things in it thats line a={1,2,3,4,5} but it could be everything possible and there are subsets like b={1} c{1,2} d{1,2,4,5}
but I cant write the progam so if you can write a program easily with no use of vector :D
think Like you have only this following tools in this program
#include <iostream>
#include <conio.h>
using namespace std;
void chap(int are [] ,int ja , int ad ) {
for (int i=ja+1;i<5;i++) {
for (int q=ad;q<=ja;q++)
cout<<are[q]<<" ";
cout<<are[i]<<endl;
}
if (!(ja==4)) chap(are,ja+1,ad);
if (!(ja==4)) chap(are,ja+1,ad+1);
}
int main() {
int ar[5];
for (int i=0;i<5;i++) {
cin>>ar[i];
}
for (int i=0;i<5;i++) {
cout<<ar[i]<<endl;
}
chap(ar,0,0);
getch();
}
and sry , Im a little young for this things so sry for my silly question :D