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