题解 | #简单密码#
简单密码
https://www.nowcoder.com/practice/ff99c43dd07f4e95a8f2f5448da3772a
#include <iostream> using namespace std; int main() { string start,end,x; while (getline(cin,start)) { getline(cin,x); int len=x.size(); for(int i=0;i<len;i++) { if((x[i]>='F'&&x[i]<='Z'))x[i]-=5; else if(x[i]>='A'&&x[i]<='E')x[i]+=21; } getline(cin,end); cout<<x<<endl; } }