View Code of Problem 3308

#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.


Back to problem 3308