Advertisement
Josif_tepe

Untitled

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