提交时间:2026-04-10 15:04:07

运行 ID: 87000

#include <iostream> #include <string> using namespace std; int main() { string s; getline(cin, s); // 读取整行,包括空格 for (char &c : s) { if (c >= 'A' && c <= 'Z') { c = (c - 'A' - 5 + 26) % 26 + 'A'; } else if (c >= 'a' && c <= 'z') { c = (c - 'a' - 5 + 26) % 26 + 'a'; } // 其他字符不变 } cout << s << endl; return 0; }