Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Complex_Conditions - created by borkins on 2017-03-28.
- */
- import java.util.Scanner;
- public class _13_PointInTheFigure
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- int h = Integer.parseInt(console.nextLine());
- int x = Integer.parseInt(console.nextLine());
- int y = Integer.parseInt(console.nextLine());
- boolean isInside = (x > 0 && x < h * 3) && (y > 0 && y < h)
- || (x > h && x < h * 2) && (y > 0 && y < h * 4);
- boolean isOutside = ((x < 0 || x > h * 3) && y <= h)
- || ((x < h || x > h * 2) && y > h)
- || (y < 0 || y > h * 4);
- if (isInside) {
- System.out.println("inside");
- }
- else if (isOutside) {
- System.out.println("outside");
- }
- else {
- System.out.println("border");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement