Advertisement
Josif_tepe

Untitled

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