Advertisement
IRusev

Problem 3. Points inside a Figure

Sep 9th, 2014
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import java.util.Locale;
  2. import java.util.Scanner;
  3.  
  4.  
  5. public class PointsInsideAFigure {
  6.  
  7. public static void main(String[] args) {
  8.  
  9. Locale.setDefault(new Locale("en", "US"));
  10.  
  11. Scanner input = new Scanner(System.in);
  12. double pointX = input.nextDouble();
  13. double pointY = input.nextDouble();
  14.  
  15.  
  16. if (pointX >= 12.5 && pointX <= 22.5 && pointY >= 6 && pointY <= 13.5) {
  17.  
  18. if (pointX > 17.5 && pointX < 20.0 && pointY > 8.5 && pointY < 13.5) {
  19. System.out.println("Outside");
  20. }
  21. else{
  22. System.out.println("Inside");
  23. }
  24.  
  25. }
  26. else{
  27. System.out.println("Outside");
  28. }
  29. input.close();
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement