简单密码
简单密码
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); } }