标签:
#include<iostream> #include<string> using namespace std; int main(int argc, char *argv[]){ string cipher; while(getline(cin,cipher),cipher!="ENDOFINPUT"){ if(cipher=="START"||cipher=="END"){ continue; } string plainText=""; for(int i=0;i<cipher.length();i++){ if(cipher[i]>='A' && cipher[i]<='Z'){ if(cipher[i]-5<'A'){ plainText+=cipher[i]+25-4; //cout<<plainText<<endl; }else{ plainText+=cipher[i]-5; //cout<<plainText<<endl; } }else{ plainText+=cipher[i]; //cout<<plainText<<endl; } } cout<<plainText<<endl; } return 0; }
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/eddy_liu/article/details/47206843