楼主: 
tyjh (....)   
2018-09-18 21:28:28https://zerojudge.tw/ShowProblem?problemid=c290
  题目如上
  找到参考解答  请问 A=A+s[i]-'0'; 中   -'0' 的意义是什么?
 #include <iostream>
using namespace std;
int main(){
    string s;
    int A,B;
    while(cin >> s){
        A=0,B=0;
        for(int i=0;i<s.length();i++){
            if (i%2){
                A=A+s[i]-'0';
            }else{
                B=B+s[i]-'0';
            }
        }
        if (A>B) cout << A-B << endl;
        else cout << B-A << endl;
    }
}