View Code of Problem 3308

#include <bits/stdc++.h>
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;
	}
}
/*
F:\temp\22484288.17818\Main.cc:2:25: error: bits/stdc++.h: No such file or directory
F:\temp\22484288.17818\Main.cc: In function 'int main()':
F:\temp\22484288.17818\Main.cc:6: error: 'string' was not declared in this scope
F:\temp\22484288.17818\Main.cc:6: error: expected ';' before 'start'
F:\temp\22484288.17818\Main.cc:9: error: 'cin' was not declared in this scope
F:\temp\22484288.17818\Main.cc:9: error: 'start' was not declared in this scope
F:\temp\22484288.17818\Main.cc:11: error: expected ';' before 'words'
F:\temp\22484288.17818\Main.cc:12: error: 'getchar' was not declared in this scope
F:\temp\22484288.17818\Main.cc:13: error: 'words' was not declared in this scope
F:\temp\22484288.17818\Main.cc:13: error: 'getline' was not declared in this scope
F:\temp\22484288.17818\Main.cc:16: error: 'cout' was not declared in this scope
F:\temp\22484288.17818\Main.cc:19: error: 'cout' was not declared in this scope
F:\temp\22484288.17818\Main.cc:21: error: 'cout' was not declared in this scope
F:\temp\22484288.17818\Main.cc:21: error: 'endl' was not declared in this scope
F:\temp\22484288.17818\Main.cc:22: error: 'end' was not declared in this scope
*/

Double click to view unformatted code.


Back to problem 3308