View Code of Problem 3308

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string a,str,b;
	while (cin >> a && a != "ENDOFINPUT") {
		cin.ignore();
		getline(cin, str);
		for (int i = 0; i < str.size(); i++)
			if (isalpha(str[i]))
				str[i] = (str[i] - 'A' - 5+26) % 26 + 'A';
		cout << str << endl;
		cin >> b;
	}
}

Double click to view unformatted code.


Back to problem 3308