Advertisement
Josif_tepe

Untitled

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