Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <algorithm>
- # include <iostream>
- # include <cstdio>
- # include <cmath>
- # include <cstdlib>
- # include <map>
- # include <cmath>
- # include <vector>
- # include <cstring>
- using namespace std;
- # define FOR(i, a, b) for (int i=a; i<b; i++)
- # define REP(i, a) FOR(i,0,a)
- # define all(c) (c).begin(), (c).end()
- # define sz(x) x.size()
- # define pb push_back
- # define UNQ(s) {sort(all(s));(s).erase(unique(all(s)),s.end());}
- # define VS vector<string>
- # define rive(s) reverse(s.begin(),s.end())
- VS Customers,List,lists;
- map<string,int>Candidate;
- //checking the frequent number of subsets
- //finding Subsets
- long pow(long a,long b) /*finds a power of b*/
- {
- long i,j=1;
- for(i=1;i<=b;i++)
- j*=a;
- return j;
- }
- long bin(int n) /*converts into binary equivalent */
- {
- long i=0,j=1,r;
- while(n)
- {
- r=n%2;
- i=i+r*j;
- n/=2;
- j*=10;
- }
- return i;
- }
- void sublist(string a)
- {
- long i,j,k,m,l=0,n=0;
- while(a[l])
- l++;
- string ss="";VS final;
- for(i=1;i<pow(2,l);i++)
- {
- k=bin(i);
- m=l-1;
- while(m>=0)
- {
- j=k/pow(10,m);
- if(j==1)
- ss.pb(a[l-1-m]);
- k=k%pow(10,m);
- m--;
- }
- final.pb(ss);
- ss.clear();
- }
- REP(i,sz(final))cout<<final[i]<<endl;
- }
- int main()
- {
- string a;cin>>a;sublist(a);
- cout<<"\n\n\n\n\n\n\nDesigned by Iftekhar ahmed eather,\nStudent of CSE (07 batch),\nBUBT, Mirpur";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement