velio84

_03_PointInsideFigure

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