fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.text.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. // your code goes here
  14.  
  15. Scanner in = new Scanner(System.in);
  16. String s ="";
  17.  
  18. String b;
  19. st.setDecimalSeparator('.');
  20. DecimalFormat f = new DecimalFormat("#,####0.0000",st);
  21. while(in.hasNextLong()){
  22.  
  23.  
  24.  
  25. b=in.nextLine();
  26. if(b.contains(" ")){
  27. for(String r:b.split(" ")){
  28.  
  29. s=r + " " + s;
  30.  
  31. }
  32. }else{
  33. s = b +" " + s;
  34. }
  35.  
  36.  
  37.  
  38.  
  39. }
  40.  
  41. s.replace("\n"," ");
  42. // System.out.println(s);
  43.  
  44. for(String r:s.split(" ")){
  45. if(!r.isEmpty()){
  46. //System.out.println(">"+r+"<");
  47.  
  48. System.out.println(f.format(Math.sqrt(Long.valueOf(r))));
  49.  
  50. }
  51. }
  52.  
  53. }
  54. }
Success #stdin #stdout 0.15s 321344KB
stdin
77282     77389292






78392872    77383 4
stdout
2.0000
278.1780
8853.9749
8797.1184
277.9964