Advertisement
coasterka

#2PointsInsideAFigure

May 13th, 2014
195
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.Locale;
  2. import java.util.Scanner;
  3.  
  4. public class PointsInsideAFigure {
  5.     public static void main(String[] args) {
  6.         Locale.setDefault(Locale.ROOT);
  7.         Scanner scan = new Scanner(System.in);
  8.         double x = scan.nextDouble();
  9.         double y = scan.nextDouble();
  10.         String result = "";
  11.         if (x >= 12.5 && x <= 22.5 &&
  12.                 y >= 6 && y <= 8.5) {
  13.             result = "Inside";
  14.         }
  15.         else if(x >= 12.5 && x <= 17.5 &&
  16.                 y >= 8.5 && y <= 13.5){
  17.             result = "Inside";
  18.         }
  19.         else if(x >= 20 && x <= 22.5 &&
  20.                 y >= 8.5 && y <= 13.5){
  21.             result = "Inside";
  22.         }
  23.         else{
  24.             result = "Outside";
  25.         }
  26.         System.out.println(result);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement