Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass {
- public static void main(String args[]) {
- java.util.Scanner scanner = new java.util.Scanner(System.in);
- int x1 = scanner.nextInt();
- int y1 = scanner.nextInt();
- int x2 = scanner.nextInt();
- while (!(x1 < x2)) {
- System.out.println("x2 must be bigger than x1");
- x2 = scanner.nextInt();
- }
- int y2 = scanner.nextInt();
- while (!(y1 < y2)) {
- System.out.println("y2 must be bigger than y1");
- y2 = scanner.nextInt();
- }
- int x = scanner.nextInt();
- int y = scanner.nextInt();
- if (((x == x1 || x == x2) && y >= y1 && y <= y2) || ((y == y1 || y == y2) && x >= x1 && x <= x2)) {
- System.out.println("Border");
- }
- else {
- System.out.println("Inside / Outside");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement