Scanner scan = new Scanner(System.in); double numbers = scan.nextDouble(); double[] avg =..????
You can get all the doubles with this code:
List numbers = new ArrayList(); while (scan.hasNextDouble()) { numbers.add(scan.nextDouble()); }