keero

06

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