简单密码

简单密码

http://www.nowcoder.com/questionTerminal/ff99c43dd07f4e95a8f2f5448da3772a

#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

int main(){

    string str;
    while(getline(cin,str)){
        if(str=="ENDOFINPUT"){
            break;
        }
        getline(cin,str);
        for(int i=0;i<str.size();++i){
            if(str[i]>='A'&&str[i]<='Z'){
                str[i]=(str[i]-'A'+26-5)%26+'A';
            }
        }
        cout<<str<<endl;
        getline(cin,str);
    }

}
全部评论

相关推荐

明天不下雨了_人机版:让我们大声的说出来:以前的未来就是现在
点赞 评论 收藏
分享
“校招”、“3-5年经验”
xiaolihuamao:逆向工程不是搞外挂的吗,好像现在大学生坐牢最多的就是诈骗罪和非法侵入计算机系统罪,发美金,还居家办公,就是怕被一锅端,
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务