九度 1127

来源:互联网 发布:广电总局封网络电视 编辑:程序博客网 时间:2024/05/24 01:37
#include <cstdio>#include <iostream>#include <string>using namespace std;#ifdef ONLINE_JUDGE                                   #define FINPUT(file)  0#define FOUTPUT(file) 0#else                                                #define FINPUT(file)  freopen(file,"r",stdin)#define FOUTPUT(file) freopen(file,"w",stdout)#endifvoid trans(string &s){    for(int i=0;i<s.length();i++)    {        if(s[i]<='Z' && s[i]>='A' && s[i]-5<'A')            s[i] = s[i] + 26 - 5;        else if(s[i]<='Z'&&s[i]>='A')            s[i] = s[i] - 5;    }}int main(){    FINPUT("in.txt");    FOUTPUT("out.txt");    string s1,s2,s3;    while(getline(cin,s1))    {           if(s1=="ENDOFINPUT")            break;                else if(s1=="START")        {            getline(cin,s2);            trans(s2);            cin>>s3;            if(s3=="END")                cout<<s2<<endl;        }                 }    return 0;}

0 0
原创粉丝点击