#include <iostream>
#include <string>
#include <cstring>
#include <cctype>
using namespace std;
void output(); //输出明文
int main()
{
string str;
while (getline(cin, str))
{
if (str == "ENDOFINPUT")
break;
else if (str == "END")
continue;
else if (str == "START")
output();
}
return 0;
}
void output()
{
string cipher;
getline(cin, cipher);
int len = cipher.length();
for (int i = 0; i < len; i++)
{
if (isupper(cipher[i])) //是大写字母
{
if (cipher[i] - 5 < 65) //需要循环
cout << char(cipher[i] - 5 + 26);
else //不需要循环
cout << char(cipher[i] - 5);
}
else //不是大写字母
cout << cipher[i];
}
cout << endl;
}
继续加油。