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