#33096: _cpp


yp11151025@yphs.tp.edu.tw (803-23江紘宇)

學校 : 臺北市私立延平高級中學
編號 : 196814
來源 : [114.45.181.154]
最後登入時間 :
2025-06-11 21:10:09

#include<iostream>
using namespace std;
int main(){
    string s;
    int A,B;
    while(cin>>s){
        A=B=0;
        for(int i=0;i<s.length();i++){
            if(i%2) A+=s[i]-'0';
            else    B+=s[i]-'0';
            
        }
        if(A>B) cout<<A-B<<endl;
        else    cout<<B-A<<endl;
    }

}