1058: 电文保密

#include<iostream>
#include<string>
using namespace std;

int main(){
    string s;
    getline(cin,s);
    for(int i =0 ; i < s.length() ; i++)
    {
        if((s[i] >= 'a' && s[i]<'w') || (s[i] >= 'A' && s[i]<'W'))
        {
        //    cout<<s[i]<<endl;
            s[i] += 4;
        //    cout<<s[i]<<endl;
        }
        if((s[i] >= 'w' && s[i]<='z' )|| (s[i] >= 'W' && s[i]<='Z'))
        {
            s[i] += 4 - 26;
        }
    }
    cout<<s<<endl;
    return 0;
}

 

posted @ 2017-03-28 14:33  shiningrise  阅读(201)  评论(0编辑  收藏  举报