Advertisement
Josif_tepe

Untitled

Mar 17th, 2023
701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.    int a, b, c, d;
  9.    cin >> a >> b >> c >> d;
  10.    int bez_a = b + c + d;
  11.    int bez_b = a + c + d;
  12.    int bez_c = a + b + d;
  13.    int bez_d = a + b + c;
  14.    int temporary_plus = 0;
  15.    if(bez_a % 2 == 0)
  16.    {
  17.        temporary_plus++;
  18.    }
  19.     if(bez_b % 2 == 0)
  20.    {
  21.        temporary_plus++;
  22.    }
  23.     if(bez_c % 2 == 0)
  24.    {
  25.        temporary_plus++;
  26.    }
  27.     if(bez_d % 2 == 0)
  28.    {
  29.        temporary_plus++;
  30.    }
  31.    if(temporary_plus == 0)
  32.    {
  33.        cout << "-" << endl;
  34.    }
  35.    else if(temporary_plus == 1)
  36.    {
  37.        cout << "+" << endl;
  38.    }
  39.    else
  40.    {
  41.        cout << "?" << endl;
  42.     }
  43.    return 0;
  44. }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement