check this out..

#include<iostream>
#include<stdlib.h>
using namespace std;

void print_sets(string *s,int pos,int n,char *to_print)
{
    if(pos==n)
    {
        return;
    }

    for(int i=0;i<s[pos].length();i++)
    {
        to_print[pos] =  s[pos][i];
        print_sets(s,pos+1,n,to_print);
        if(pos==n-1)
        {
            for(int j=0;j<n;j++)cout<<to_print[j];
            cout<<endl;
        }
    }
    return;
}
int main()
{
    int n;
    cin>>n;
    string s[n];

    for(int i=0;i<n;i++)
    {
        cin>>s[i];
    }
 char *to_print = new char[n];
    print_sets(s,0,n,to_print);
}

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to