fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Task4
  5. {
  6. public static void main (String[] args)
  7. {
  8. Scanner input = new Scanner(System.in);
  9. int n = input.nextInt();
  10. double p=1;
  11. for(;n>0;n--) p*=input.nextDouble();
  12. System.out.println(Math.sqrt(Math.abs(p)));
  13. }
  14. }
Success #stdin #stdout 0.14s 2841600KB
stdin
5 1 2 3 4 5
stdout
10.954451150103322