RECURSION-DICTIONARY ORDER(LARGER) --some test cases giving wrong ans

link to ques —https://hack.codingblocks.com/contests/c/457/361

#include
#include <string.h>
using namespace std;

void permute(char* in,int i,char* x)
{
if(in[i]==’\0’)
{
if(strcmp(in,x)>0){
cout<<in<<endl;}
return;
}

for(int j=i;in[j]!=’\0’;j++)
{
swap(in[i],in[j]);
permute(in,i+1,x);
swap(in[i],in[j]);
}
}

int main()
{
char in[100],x[100];

cin>>in;
strcpy(x,in);
permute(in,0,x);
return 0;
}

you should first store all such type of strings in a data structure and then you should print it in the same order as it occurs in dictionary.
You are creating permutations of the given string , its right but print it in same order
Other parts of ur code is working fine (Y)