#1939: Real ans, those guys down there are fake they didn't give you the answer


1753980-3@g.puiching.edu.mo (P5A31蒲雋浠)

School : No School
ID : 2571
IP address : [192.168.120.33]
Last Login :
2025-03-20 12:13:05
a003. 提款卡密碼 -- 板橋高中教學題 | From: [192.168.120.33] | Post Date : 2025-04-14 21:09

#include <iostream>
#include <string>
#include <cstdlib> // for abs function

using namespace std;

int main() {
    string s;
    while (cin >> s) {
        for (int i = 0; i < 6; ++i) {
            int diff = abs(s[i] - s[i+1]);
            cout << diff;
        }
        cout << endl;
    }
    return 0;
}
 
ZeroJudge Forum