Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Ex23_PointOnRectangleBorderv3 {
  4.     public static void main(String[] args) {
  5.  
  6.         Scanner sc = new Scanner(System.in);
  7.  
  8.         double x1 = sc.nextDouble();
  9.         double y1 = sc.nextDouble();
  10.         double x2 = sc.nextDouble();
  11.         double y2 = sc.nextDouble();
  12.         double x = sc.nextDouble();
  13.         double y = sc.nextDouble();
  14.  
  15.         if (x == x1 || x == x2 && y >= y1 && y <= y2)
  16.             System.out.println("Border");
  17.          else if (y == y1 || y == y2 && x >= x1 && x <= x2)
  18.             System.out.println("Border");
  19.  
  20.          else
  21.             System.out.println("Inside/Outside");
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement