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 scan = new Scanner(System.in);
  10. int x1 = scan.nextInt(), y1 = scan.nextInt();
  11. int x2 = scan.nextInt(), y2 = scan.nextInt(), z2 = scan.nextInt();
  12. double D = 1/Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1) + z2 * z2);
  13. System.out.print(D);
  14. }
  15. }
Success #stdin #stdout 0.16s 321344KB
stdin
10 30 20 40 110
stdout
0.009016696346674322