很累啊,又是一道无聊的水题。。。
/*
zoj_1392 字符串处理
水题。。
*/
#include <iostream>
#include <cstdio>
#include <string.h>
#include <map>
using namespace std;
map <char,char>mymap;
char c[110];
int main()
{
mymap['A']='V'; mymap['H']='C'; mymap['O']='J'; mymap['V']='Q';
mymap['B']='W'; mymap['I']='D'; mymap['P']='K'; mymap['W']='R';
mymap['C']='X'; mymap['J']='E'; mymap['Q']='L'; mymap['X']='S';
mymap['D']='Y'; mymap['K']='F'; mymap['R']='M'; mymap['Y']='T';
mymap['E']='Z'; mymap['L']='G'; mymap['S']='N'; mymap['Z']='U';
mymap['F']='A'; mymap['M']='H'; mymap['T']='O';
mymap['G']='B'; mymap['N']='I'; mymap['U']='P';
string s;
int i;
while( cin>>s && s!="ENDOFINPUT" )
{
cin.get();
cin.getline(c,110);
cin>>s;
for( i=0;i<strlen(c);i++ )
{
if( c[i]>='A' && c[i]<='Z' )
cout<<mymap[ c[i] ];
else cout<<c[i];
}
cout<<endl;
}
return 0;
}