Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Complex_Conditions - created by borkins on 2017-03-26.
- */
- import java.util.Scanner;
- public class _06_PointOnRectangleBorder
- {
- 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 pX = Double.parseDouble(console.nextLine());
- double pY = Double.parseDouble(console.nextLine());
- boolean onBorder = (pX == x1 || pX == x2) && (pY >= y1 && pY <= y2)
- || (pY == y1 || pY == y2) && (pX >= x1 && pX <= x2);
- System.out.println((onBorder) ? "Border" : "Inside / Outside");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment