Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Exam_101_January_2016 - created by borkins on 2017-05-03.
- */
- import java.util.Scanner;
- public class _04_PointInFigure
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- int x = Integer.parseInt(console.nextLine());
- int y = Integer.parseInt(console.nextLine());
- boolean inVertical = (x >= 4 && x <= 10) && (y >= -5 && y <= 3);
- boolean inHorizontal = (x >= 2 && x <= 12) && (y >= -3 && y <= 1);
- System.out.println((inVertical || inHorizontal) ? "in" : "out");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment