| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 78480 | sh25_wangsj | 加密的病历单 | C++ | Accepted | 0 MS | 256 KB | 728 | 2025-12-26 15:48:07 |
#include <iostream> #include <string> #include <algorithm> using namespace std; string decrypt(const string& encrypted) { string decrypted = encrypted; int n = decrypted.size(); // 逆序存储 reverse(decrypted.begin(), decrypted.end()); // 循环右移3位并大小写反转 for (int i = 0; i < n; ++i) { char c = decrypted[i]; if (islower(c)) { decrypted[i] = toupper((c - 'a' + 3) % 26 + 'A'); } else { decrypted[i] = tolower((c - 'A' + 3) % 26 + 'a'); } } return decrypted; } int main() { string encrypted; cin >> encrypted; cout << decrypt(encrypted) << endl; return 0; }