【題解】ZeroJudge f434: 458 – The Decoder

【題目敘述】https://zerojudge.tw/ShowProblem?problemid=f434 (考生答對率: 44.97%)

// 找出 in / out 字串的 ASCII 距離
#include <iostream>
using namespace std;

int main() {
    string s = "1JKJ'pz'{ol'{yhklthyr'vm'{ol'Jvu{yvs'Kh{h'Jvywvyh{pvu5";
    string t = "*CDC is the trademark of the Control Data Corporation.";
    
    for (int i = 0; i < s.size(); i++) {
        cout << t[i] - s[i] << " ";
    }
    cout << "\n";
    return 0;
}
#include <iostream>
using namespace std;

int main() {
    string s;
    while (cin >> s) {
        for (int i = 0; i < s.size(); i++) {
            cout << char(s[i] - 7);
        }
        cout << "\n";
    }
    return 0;
}

分享本文 Share with friends