Advertisement
galinyotsev123

ProgBasicsJavaBook4.1ComplexConditions03PointinRectangle

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