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