Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<iostream>
  3. #include<iomanip>
  4. #include<fstream>
  5. #include<cstdlib>
  6. #include<string.h>
  7. #include<cmath>
  8. using namespace std;
  9. int main()
  10. {
  11.     char A[130];
  12.     while (cin >> A)
  13.     {
  14.         int s=0;
  15.         for (int i = 0; A[i] != '\0'; i++)
  16.         {
  17.             if (A[i] == '-')
  18.                 i++;
  19.             s += A[i] - '0';
  20.         }
  21.         if (s % 3 == 0)
  22.             cout << "yes" << endl;
  23.         else
  24.             cout << "no" << endl;
  25.         memset(A, 0, sizeof(A));
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement