Advertisement
Josif_tepe

Untitled

Feb 3rd, 2024
1,020
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a, b, c;
  8.     cin >> a >> b >> c;
  9.    
  10.     int d = a + b + c;
  11.     if(d % 3 == 0) {
  12.         cout << 0 << endl;
  13.     }
  14.     else {
  15.         if(d % 3 == 2) {
  16.             cout << 1 << endl;
  17.         }
  18.         else {
  19.             cout << 2 << endl;
  20.         }
  21.     }
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement