Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class _03_PointsInsideFigure {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double x = scanner.nextDouble();
- double y = scanner.nextDouble();
- boolean isInsideFirstFigure = (x >= 12.5 && x <= 17.5)
- && (y >= 8.5 && y <= 13.5);
- boolean isInsideSecondFigure = (x >= 20 && x <= 22.5)
- && (y >= 8.5 && y <= 13.5);
- boolean isInsideThirdFigure = (x >= 12.5 && x <= 22.5)
- && (y >= 6 && y <= 8.5);
- if (isInsideFirstFigure || isInsideSecondFigure || isInsideThirdFigure) {
- System.out.println("Inside");
- }
- else {
- System.out.println("Outside");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement