Advertisement
DidiMilikina

13. Point in the Figure

Oct 5th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int h, x, y;
  6.     cin >> h >> x >> y;
  7.  
  8.     if ((x < h && y > h) ||
  9.         (x > 2 * h && y > h) ||
  10.         (x < 0) || (x > 3 * h) ||
  11.         (y < 0) || (y > 4 * h))
  12.     {
  13.         cout << "outside" << endl;
  14.     }
  15.     else if ((x > 0 && x < 3 * h && y > 0 && y < h) ||
  16.         (x > h && x < 2 * h && y < 4 * h && y > 0))
  17.     {
  18.         cout << "inside" << endl;
  19.     }
  20.     else
  21.     {
  22.         cout << "border" << endl;
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement