View Code of Problem 3308

#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
#include <cctype>
using namespace std;

int main()
{
    string str;
    while(cin >> str && str != "ENDOFINPUT"){
        getchar();
        getline(cin, str);
        for (int i = 0; i < str.size();i++){
            if(isupper(str[i]))
                cout << char((str[i] - 'A' + 26 - 5) % 26 + 'A');
            else
                cout << str[i];
        }
        cout << endl;
        cin >> str;
    }
}

Double click to view unformatted code.


Back to problem 3308