Advertisement
Guest User

03PointsInsideAFigure

a guest
May 12th, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class PointsInsideAFigure {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner input = new Scanner(System.in);
  8.         String[] points = input.nextLine().split(" ");
  9.         double x = Double.parseDouble(points[0]);
  10.         double y = Double.parseDouble(points[1]);
  11.         if((x>=12.5 && x<=17.5) && (y<=13.5 && y>=6)){
  12.             System.out.println("Inside");
  13.         }
  14.         else if((x>=12.5 && x<=22.5) && (y<=8.5 && y>=6)) {
  15.             System.out.println("Inside");
  16.         }
  17.         else if((x>=20 && x<=22.5) && (y<=13.5 && y>=6)) {
  18.             System.out.println("Inside");
  19.            
  20.            
  21.         }
  22.         else {
  23.             System.out.println("Outside");
  24.         }
  25.        
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement