Multiple of 9

Problem Link

Solution by JAPAMISTERIOSO100 pts

Code / Notes

// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
string x;
cin >> x;
int soma =0;
for (int i=0;i < x.size(); i++){
     soma= soma+ x[i]-48;
}
if (soma % 9 == 0){
    cout << "Yes";
}else {
    cout << "No";
}

}

Last updated 3 weeks, 3 days ago


« Back to problem