You can say 11

 avatar
user_6817964
c_cpp
2 years ago
609 B
1
Indexable
Never
#include <iostream>
#include <string>
using namespace std;

main(){
    string x;
    while(cin >> x){
        if(x == "0")
            break;

        cout << x;
        int a = 0, b = 0;

        for(int i = 0; i < x.length(); i++){
            if(i % 2 == 0){
                a = a + (int)x[i] - 48;
            }
            else{
                b = b + (int)x[i] - 48;
            }
        }

        if((a-b)%11 == 0){
            cout << " is a multiple of 11." << endl;
        }
        else{
            cout << " is not a multiple of 11." << endl;
        }
    }

}