/* The Great Win32 Language Shootout http://dada.perl.it/shootout/ contributed by Isaac Gouy (Nice novice) To compile: nicec --sourcepath=.. -d=. -a moments.jar moments To run: java -jar moments.jar < input.txt > out.txt */ import java.io.*; import java.text.*; import random; // reuse floatFormat import sumcol; // reuse bufferedStdInReader() void main(String[] args){ double num, sum = 0; ArrayListnumbers = new ArrayList(); try { BufferedReader reader = bufferedStdInReader(); ?String line; while ((line = reader.readLine()) != null){ num = Double.parseDouble(line); sum += num; numbers.add(num); }; } catch (IOException e) { System.err.println(e); } double mean = 0.0; double average_deviation = 0.0; double standard_deviation = 0.0; double variance = 0.0; double skew = 0.0; double kurtosis = 0.0; double median = 0.0; double deviation = 0.0; int i, n, mid = 0; n = numbers.size(); mean = sum/n; for (i=0; i