#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<map> #include<vector> #include<algorithm> #include<cctype> using namespace std; int main() { string start, end; char pass[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' }; while (cin >> start) { if (start == "ENDOFINPUT") break; string words; getchar(); getline(cin, words); for (int i = 0; i < words.size(); ++i) { if (words[i] >= 'A' && words[i] <= 'Z') { cout << (char)pass[words[i] - 'A']; continue; } cout << words[i]; } cout << endl; cin >> end; } return 0; } |
Double click to view unformatted code.