#include<iostream> #include<string> using namespace std; int main() { string start; string end; string msg; string chars = "VWXYZABCDEFGHIJKLMNOPQRSTU"; while (getline(cin, start)&&start!="ENDOFINPUT") { getline(cin, msg); for (int i = 0;i < msg.length();i++) { if (msg[i] >= 'A'&&msg[i] <= 'Z') { msg[i] = chars[msg[i] - 'A']; } } getline(cin, end); cout << msg << endl; } } |
Double click to view unformatted code.