SHARE
TWEET

Untitled

a guest Jan 21st, 2020 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     setlocale(LC_ALL, "rus");
  7.     int xk, yk, xc, yc, p;
  8.     xk = 0 + rand() % 10;
  9.     yk = 0 + rand() % 10;
  10.     for (int i = 1; i < 6; i++)
  11.     {
  12.         cout << "укажите координаты" << endl;
  13.         cin >> xc >> yc ;
  14.         {
  15.             if (xc == xk && yc == yk) cout << "попадание" << endl;
  16.             break;
  17.         }
  18.         if (xc > xk) cout << "уменьшить x" << endl;
  19.         if (xc < xk) cout << "увеличить x" << endl;
  20.         if (yc > yk) cout << "уменьшить y" << endl;
  21.         if (yc < yk) cout << "увеличить y" << endl;
  22.     }
  23.     if (p = 0) cout << "в другой раз... " << endl;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top