fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Pendulum {
  6. public static void main (String[] args) throws java.lang.Exception {
  7. Scanner scanner = new Scanner(System.in);
  8. double x0 = scanner.nextDouble();
  9. double y0 = scanner.nextDouble();
  10. double z0 = scanner.nextDouble();
  11. double x1 = scanner.nextDouble();
  12. double y1 = scanner.nextDouble();
  13. double z1 = scanner.nextDouble();
  14. double res;
  15. //System.out.print(x0+" "+y0+" "+z0+" "+x1+" "+y1+" "+z1);
  16. res = Math.sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0)+(z1-z0)*(z1-z0));
  17. System.out.print("coordinats of the low point"+"\n"+ x0+" "+y0+" "+(z0-res)+"\n");
  18. System.out.print("coordinats of the another high point"+"\n"+(x0-(x1-x0))+" "+(y0-(y1-y0))+" "+z1);
  19. }
  20. }
Success #stdin #stdout 0.16s 321280KB
stdin
6 7 7 1 0 2
stdout
coordinats of the low point
6.0 7.0 -2.9498743710661994
coordinats of the another high point
11.0 14.0 2.0