Ledger Nano X - The secure hardware wallet
SHARE
TWEET

x,y in/outsquare

JOHNYTHEWINNER Jan 26th, 2020 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # include <iostream>
  2. using namespace std;
  3. #include <iomanip>
  4. #include <math.h>
  5. #include <cmath>
  6.  
  7.  
  8.  
  9. int main()
  10. {
  11.     double x1, y1, x2, y2, x, y;
  12.     cin >> x1;
  13.     cin >> y1;
  14.     cin >> x2;
  15.     cin >> y2;
  16.     cin >> x;
  17.     cin >> y;
  18.     bool vertical = (x == x1 || x == x2) && (y >= y1 && y <= y2);
  19.     bool horizontal = (x >= x1 && x <= x2) && (y == y1 || y == y2);
  20.     if (horizontal == 1 || vertical == 1)
  21.     {
  22.         cout << "Border" << endl;
  23.     }
  24.     else
  25.     {
  26.         cout << "Inside / Outside" << endl;
  27.     }
  28.  
  29.  
  30.  
  31.    
  32.  
  33.     return 0;
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top