fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner in = new Scanner(System.in);
  10. double b=in.nextDouble();
  11. double a=in.nextDouble();
  12. double inf = 1.0 / 0;
  13. double c;
  14. c=(b<a)?inf:Math.sqrt(b*b-a*a);
  15. System.out.println(c);
  16. }
  17. }
Success #stdin #stdout 0.14s 31212KB
stdin
10 6
stdout
8.0