#include "stdafx.h"

#include <iostream>
#include <string>
using namespace std;
int main()
{
string tol,result;
while(getline(cin,tol)) {
unsigned i=;
if(tol=="START") continue;
else if(tol=="END") cout<<result<<endl;
else if(tol=="ENDOFINPUT") break;
else {
while(i<tol.size()) {
if(tol[i]< &&tol[i]>=)//A-E
tol[i]= tol[i]+ ;
else if(tol[i]>=&&tol[i]<=)//F-Z
tol[i]= tol[i]- ;
i++;
}
result=tol;
}
}
return ;
}

  可用map映射字母一一对应来替换,此处我就直接替换了,只是不方便扩展

05-01 03:07