View Code of Problem 3308

#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
using namespace std;

int main() {
	string start;
	string end;
	string msg;
	string chars = "VWXYZABCDEFGHIJKLMNOPQRSTU";
	while (cin >> start&&start!="ENDOFINPUT") {
		getchar();
		getline(cin, msg);
		for (int i = 0;i < msg.length();i++) {
			if (msg[i] >= 'A'&&msg[i] <= 'Z') {
				msg[i] = chars[msg[i] - 'A'];
			}
		}
		cin >> end;
		getchar();
		cout << msg << endl;
	}
}
/*
F:\temp\22480822.14352\Main.cc: In function 'int main()':
F:\temp\22480822.14352\Main.cc:14: error: 'getchar' was not declared in this scope
*/

Double click to view unformatted code.


Back to problem 3308