Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<iostream>
- #include<iomanip>
- #include<fstream>
- #include<cstdlib>
- #include<string.h>
- #include<cmath>
- using namespace std;
- int main()
- {
- char A[130];
- while (cin >> A)
- {
- int s=0;
- for (int i = 0; A[i] != '\0'; i++)
- {
- if (A[i] == '-')
- i++;
- s += A[i] - '0';
- }
- if (s % 3 == 0)
- cout << "yes" << endl;
- else
- cout << "no" << endl;
- memset(A, 0, sizeof(A));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement