1 条题解

  • 0
    @ 2025-5-1 13:59:22
    #include <iostream>
    #include <string>
    
    int main() {
        std::string ciphertext;
        std::getline(std::cin, ciphertext);
    
        std::string plaintext;
        for (char c : ciphertext) {
            if (c >= 'A' && c <= 'Z') {
                // 解密逻辑
                char decrypted = (c - 'A' - 5 + 26) % 26 + 'A';
                plaintext += decrypted;
            } else {
                plaintext += c;
            }
        }
    
        std::cout << plaintext << std::endl;
    
        return 0;
    }
    
    • 1

    信息

    ID
    391
    时间
    1000ms
    内存
    256MiB
    难度
    10
    标签
    递交数
    2
    已通过
    2
    上传者