Advertisement
DidiMilikina

06. Point on Rectangle Border

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