vstoyanov

Оператори и Изрази 8

May 12th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. import org.omg.CORBA.MARSHAL;
  2. import org.omg.Messaging.SYNC_WITH_TRANSPORT;
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class Main {
  7.  
  8.     public static void main(String[] args) {
  9.         Scanner scanner=new Scanner (System.in);
  10.  
  11.         boolean hasInside=false;
  12.  
  13.            Double x=Double.parseDouble(scanner.nextLine());
  14.         Double y=Double.parseDouble(scanner.nextLine());
  15. int radius=5;
  16.  
  17. double dx=Math.abs(x-0);
  18. double dy= Math.abs(y-0);
  19.  
  20.  
  21.         if(dx*dx+dy*dy<=radius*radius)
  22.         {
  23.  
  24.             hasInside=true;
  25.         }
  26.  
  27.  
  28.         System.out.println(hasInside);
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment