fork download
  1. import java.util.*;
  2.  
  3. public class Main
  4. {
  5. public static void main (String[] args) throws java.lang.Exception
  6. {
  7. Scanner in = new Scanner(System.in);
  8. double
  9. Ax = in.nextDouble(),
  10. Ay = in.nextDouble(),
  11. Az = in.nextDouble(),
  12. Bx = in.nextDouble(),
  13. By = in.nextDouble(),
  14. Bz = in.nextDouble(),
  15. Cx = in.nextDouble(),
  16. Cy = in.nextDouble(),
  17. Cz = in.nextDouble();
  18. double V = (Ax * (By * Cz - Bz * Cy) - Bx * (Ay * Cz - Az * Cy) + Cx * (Ay * Bz - Az * By)) / 6.0;
  19. if (V < 0) V *= -1;
  20. System.out.print(V);
  21. }
  22. }
Success #stdin #stdout 0.12s 31316KB
stdin
0 0 1
0 1 0
1 0 0
stdout
0.16666666666666666