atutsasha
Mar 16th, 2023
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     string a, b, c, d;
  8.     int a1{}, b1{}, c1{}, d1{};
  9.  
  10.     cin >> a >> a1 >> b >> b1 >> c >> c1 >> d >> d1;
  11.     /*
  12.         red 3 green 3 green 2 green -1
  13.         2 3
  14.         red 2 green 1 red 3 red 3
  15.         3
  16.         red 1 green 2 blue 3 yellow 3
  17.  
  18.         grey 5 grey 5 grey 5 grey 5
  19.         1 2 3
  20.         red 3 green 3 green 2 ? -1
  21.         1 2 3
  22.     */
  23.     if (d == "?" && d1 == -1)
  24.     {
  25.         cout << 1 << endl
  26.              << 2 << endl
  27.              << 3 << endl;
  28.     }
  29.     else if (d != "?" && d1 != -1)
  30.     {
  31.  
  32.         if (a == d && a1 == d1)
  33.         {
  34.             cout << 1 << endl;
  35.         }
  36.         if (b == d && b1 == d1)
  37.         {
  38.             cout << 2 << endl;
  39.         }
  40.         if (c == d && c1 == d1)
  41.         {
  42.             cout << 3 << endl;
  43.         }
  44.     }
  45.     else if (d == "?" || d1 == -1)
  46.     {
  47.         if (a == d || a1 == d1)
  48.         {
  49.             cout << 1 << endl;
  50.         }
  51.         if (b == d || b1 == d1)
  52.         {
  53.             cout << 2 << endl;
  54.         }
  55.         if (c == d || c1 == d1)
  56.         {
  57.             cout << 3 << endl;
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment