简单题
View Code
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
string st;
int main()
{
//freopen("t.txt", "r", stdin);
while (getline(cin, st))
{
if (st == "ENDOFINPUT")
break;
getline(cin, st);
for (int i = 0; i < st.length(); i++)
if (st[i] <= 'Z' && st[i] >= 'A')
st[i] = (st[i] - 'A' - 5 + 26) % 26 + 'A';
cout << st << endl;
getline(cin, st);
}
return 0;
}
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
string st;
int main()
{
//freopen("t.txt", "r", stdin);
while (getline(cin, st))
{
if (st == "ENDOFINPUT")
break;
getline(cin, st);
for (int i = 0; i < st.length(); i++)
if (st[i] <= 'Z' && st[i] >= 'A')
st[i] = (st[i] - 'A' - 5 + 26) % 26 + 'A';
cout << st << endl;
getline(cin, st);
}
return 0;
}