Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package my.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- double x1 = Double.parseDouble(console.nextLine());
- double y1 = Double.parseDouble(console.nextLine());
- double x2 = Double.parseDouble(console.nextLine());
- double y2 = Double.parseDouble(console.nextLine());
- double x = Double.parseDouble(console.nextLine());
- double y = Double.parseDouble(console.nextLine());
- boolean isInside = ((x > x1) && (x < x2)) && ((y > y1) && (y < y2));
- boolean Border = (((x == x1 || x == x2) && (y >= y1) && (y <= y2)) || ((y == y1 || y == y2) && (x >= x1) && (x <= x2)));
- if (isInside){
- System.out.println("Inside");
- } else if (Border){
- System.out.println("Border");
- } else {
- System.out.println("Outside");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement