borkins

03. Point in Rectangle

Mar 26th, 2017
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. /**
  2.  * Project: Complex_Conditions - created by borkins on 2017-03-25.
  3.  */
  4.  
  5. import java.util.Scanner;
  6.  
  7. public class _03_PointInRectangle
  8. {
  9.     public static void main(String[] args)
  10.     {
  11.         Scanner console = new Scanner(System.in);
  12.        
  13.         double x1 = Double.parseDouble(console.nextLine());
  14.         double y1 = Double.parseDouble(console.nextLine());
  15.         double x2 = Double.parseDouble(console.nextLine());
  16.         double y2 = Double.parseDouble(console.nextLine());
  17.         double pX = Double.parseDouble(console.nextLine());
  18.         double pY = Double.parseDouble(console.nextLine());
  19.        
  20.         boolean isInside = (pX >= x1 && pX <= x2) && (pY >= y1 && pY <= y2);
  21.         System.out.println(isInside ? "Inside" : "Outside");
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment