Введите список символов в строке, то есть "aA1". Это необходимо для проверки всех возможных комбинаций, таких как aA1,1Aa и т. Д.
#include<stdio.h>
#include<string.h>
#include<alloc.h>
#include<conio.h>
void swap(char*,int);
void gotoloop(char*,int);
void main()
{
char *ch;
int i,j,k,l;
ch=(char*)malloc(20);
//clrscr();
printf("Enter the string\n"); //Enter AAaa11 for your case
gets(ch);
l=strlen(ch);
gotoloop(ch,l);
//if flag !=false call encryption.
return;
}
void gotoloop(char *ch,int l)
{
int i,k;
k=l;
if(l<=1)
return;
for(i=0;i<k;i++)
{
swap(ch,k);
l--;
gotoloop(ch,l);
l++;
if(k==2) {
printf("\n%s ",ch);//check this from the list, if not found set FLAG=false
}
}
}
void swap(char *ch,int r)
{
char c;
int i;
c=ch[r-1];
for(i=r-1;i>0;i--)
ch[i]=ch[i-1];
ch[0]=c;
}