【題解】ZeroJudge a065: 提款卡密碼

【題目敘述】https://zerojudge.tw/ShowProblem?problemid=a065
【Tag】字串、字元、ASCII

#include <iostream>
using namespace std;
 
int main() {
    string s;
    while (cin >> s) {
        for (int i = 0; i < 6; i++) {
            cout << abs(s[i] - s[i + 1]);
        }
        cout << "\n";
    }
}
分享本文 Share with friends