Advertisement
DidiMilikina

06. Point on Rectangle Border

Oct 1st, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     double x, x1, x2, y, y1, y2;
  7.     cin >> x1 >> y1 >> x2 >> y2 >> x >> y;
  8.  
  9.     if (x1 < x2 && y1 < y2)
  10.     {
  11.         if ((x == x1 || x == x2) && (y >= y1) && (y <= y2))
  12.         {
  13.             cout << "Border" << endl;
  14.         }
  15.         else if ((y == y1 || y == y2) && (x >= x1) && (x <= x2))
  16.         {
  17.             cout << "Border" << endl;
  18.         }
  19.         else
  20.         {
  21.             cout << "Inside / Outside" << endl;
  22.         }
  23.  
  24.     }
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement