Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
112662 | 魏宏搏 | 情报加密 | C++ | Accepted | 0 MS | 276 KB | 657 | 2025-03-09 20:54:19 |
#include <iostream> using namespace std; int main() { string s; getline(cin, s); string result = " "; for (int i = 0; i < s.length(); i++) { char c = s[i]; if ((c >= 'a' && c < 'z') || (c >= 'A' && c < 'Z')) { result += char(c + 1); } else if (c == 'z') { result += 'a'; } else if (c == 'Z') { result += 'A'; } else { result += c; } } size_t start = result.find_first_not_of(' '); if (start != string::npos) { result = result.substr(start); } cout << result << endl; return 0; }