Advertisement
Josif_tepe

Untitled

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