#include <iostream>
using namespace std;
char * b[] = {"BcBc","dc","Ac","df","io","Jk","MnoP","jh","dio","dic","MA","id","nm",
"kd","Hkd","ki","fd","cd","kdo","nm","hj","iod","cid","am","dm","xy"};
void f(char a1[],int n,char *b1[])
{
const int size = strlen(b1[n]);
char * c1 = b1[n];
for(int i = 0;i < size;i++)
{
if(c1[i] >= 'a' && c1[i] <= 'z')
cout<<c1[i];
else
{
for(int j = 0;j < 26 && a1[j] != c1[i];++j);
f(a1,j,b1);
}
}
}
int main()
{
char a[26] = {'A','B','C','D','E','F','G','H','J','K','L','M','N','O','P','Q','R','S','T',
'U','V','W','X','Y','Z'};
char c[2];
int j;
cin>>c;//输入AB
for(int i = 0;i < 2;i++)
{
if(c[i] >= 'a' && c[i] <= 'z')
cout<<c[i];
else
{
for(j = 0;j < 26 && a[j] != c[i] ;++j);
f(a,j,b);
}
}
cout<<endl;
system("pause");
return 0;
}
[此贴子已经被作者于2006-10-14 11:20:28编辑过]