fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Main
  6. {
  7. static Scanner sc = new Scanner(System.in);
  8.  
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. double mul = 1;
  12. double x;
  13. while(sc.hasNext()){
  14. x = sc.nextDouble();
  15. if(x < 0){
  16. break;
  17. }
  18. mul *= x;
  19. }
  20. System.out.println(mul);
  21. }
  22. }
Success #stdin #stdout 0.19s 321344KB
stdin
0.5 0.4 0.3 0.2 0.1 -0.1 -0.2 -0.3
stdout
0.0012000000000000001