Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement