#include <iostream>
#include <string>
#include <map>
using namespace std;
char str[210];
int main()
{
char b[26] = {'V', 'W','X', 'Y', 'Z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U'};
map<char, char> wordMap;
for(int i = 0; i < 26; i++)
{
wordMap[i+'A'] = b[i];
}
string s;
while(cin >> s, s != "ENDOFINPUT")
{
getchar();
gets(str);
int n = strlen(str);
for(int i = 0; i < n; i++)
{
if(!isalpha(str[i]))
cout << str[i];
else
cout << wordMap[str[i]];
}
cout << endl;
cin >> s;
}
return 0;
}
HDU 1048 map
最新推荐文章于 2021-07-25 17:07:39 发布