Advertisement
psi_mmobile

Untitled

May 4th, 2022
685
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. public class MyClass {
  2.     public static void main(String args[]) {
  3.         java.util.Scanner scanner = new java.util.Scanner(System.in);
  4.         int x1 = scanner.nextInt();
  5.         int y1 = scanner.nextInt();
  6.         int x2 = scanner.nextInt();
  7.         while (!(x1 < x2)) {
  8.             System.out.println("x2 must be bigger than x1");
  9.             x2 = scanner.nextInt();
  10.         }
  11.         int y2 = scanner.nextInt();
  12.         while (!(y1 < y2)) {
  13.             System.out.println("y2 must be bigger than y1");
  14.             y2 = scanner.nextInt();
  15.         }
  16.         int x = scanner.nextInt();
  17.         int y = scanner.nextInt();
  18.        
  19.         if (((x == x1 || x == x2) && y >= y1 && y <= y2) || ((y == y1 || y == y2) && x >= x1 && x <= x2)) {
  20.             System.out.println("Border");
  21.         }
  22.         else {
  23.             System.out.println("Inside / Outside");
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement