Advertisement
Josif_tepe

Untitled

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