galinyotsev123

ProgBasics04Nested-Statements-P03pointInRectangle

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