qshy
Feb 20th, 2023
37
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.    
  8.     string c1, c2, c3, cx;
  9.     int h1, h2, h3, hx;
  10.    
  11.     cin >> c1 >> h1 >> c2 >> h2 >> c3 >> h3 >> cx >> hx;
  12.    
  13.     if (((c1 == cx) && (h1 == hx)) || ((c1 == cx) && (hx == -1)) || ((cx == "?"s) && (h1 == hx)) || ((cx == "?"s) && (hx == -1))) {
  14.         cout << "1" << endl;
  15.     }
  16.     if (((c2 == cx) && (h2 == hx)) || ((c2 == cx) && (hx == -1)) || ((cx == "?"s) && (h2 == hx)) || ((cx == "?"s) && (hx == -1))) {
  17.         cout << "2" << endl;
  18.     }
  19.     if (((c3 == cx) && (h3 == hx)) || ((c3 == cx) && (hx == -1)) || ((cx == "?"s) && (h3 == hx)) || ((cx == "?"s) && (hx == -1))) {
  20.         cout << "3" << endl;
  21.     }
  22.    
  23. }
Advertisement
Add Comment
Please, Sign In to add comment