#include<iostream>
#include<cmath>
#include<string>
using namespace std;
int main(){
string x;
while(true){
getline(cin,x,'\n');
long a=0,b=0;
bool ab=true;
for(int t=0;t!=x.length();t++){
a+=(ab?(x[t]-'0'):0);
b+=(ab?0:(x[t]-'0'));
ab=!ab;
// cout<<"test\n"<<a<<" "<<b<<" "<<x<<endl;
}
cout<<abs(a-b)<<endl;
}
return 0;
}
是TLE吧
改成while(getline(cin, x))