>>644
ヒント:
int f[];
for(i=0;x[0][i];i++)f[x[0][i]-'A']=i;
for(i=0;a[i];i++) a[i]=x[1][ f[a[i]] ];
がコアな処理