读取整行字符串
限制输入字母在A至Z之间
按字符顺序进行解密
#include#include #include using namespace std; int main() { string s; getline(cin, s); //读整行 for (int i = 0; i < s.length(); i++) { if (s[i] >= 'A' && s[i] <= 'Z') //只对字母解密 s[i] = char((s[i] - 'A' - 5 + 26) % 26 + 'A'); } cout << s << endl; return 0; }



