Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "rus");
- int xk, yk, xc, yc, p;
- xk = 0 + rand() % 10;
- yk = 0 + rand() % 10;
- for (int i = 1; i < 6; i++)
- {
- cout << "укажите координаты" << endl;
- cin >> xc >> yc ;
- {
- if (xc == xk && yc == yk) cout << "попадание" << endl;
- break;
- }
- if (xc > xk) cout << "уменьшить x" << endl;
- if (xc < xk) cout << "увеличить x" << endl;
- if (yc > yk) cout << "уменьшить y" << endl;
- if (yc < yk) cout << "увеличить y" << endl;
- }
- if (p = 0) cout << "в другой раз... " << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement