fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner in = new Scanner(System.in);
  10. double sum = 0.0, number = 0.0, x = 1;
  11. while (in.hasNext() && x >= 0) {
  12. x = in.nextDouble();
  13. sum += x;
  14. number++;
  15. }
  16. System.out.println(sum / number);
  17. }
  18. }
Success #stdin #stdout 0.14s 321280KB
stdin
Standard input is empty
stdout
NaN