Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- string s;
- bool pr = 0;
- long long ch, nech;
- int main(){
- cin >> s;
- for(int i = 0; i < s.size(); i++){
- if(pr){
- ch+= ((int)s[i]-48);
- pr = 0;
- }
- else{
- nech+= ((int)s[i]-48);
- pr = 1;
- }
- }
- if((ch - nech) % 11 == 0){
- cout << "YES";
- }
- else{
- cout << "NO";
- }
- cout << endl;
- cout << ch - nech;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement