Scanner scan = new Scanner(System.in); double numbers = scan.nextDouble(); double[] avg =..????
解决方法
你可以尝试这样的东西:
public static void main (String[] args) { Scanner input = new Scanner(System.in); double[] numbers = new double[5]; for (int i = 0; i < numbers.length; i++) { System.out.println("Please enter number"); numbers[i] = input.nextDouble(); } }
这似乎是非常基本的东西,除非我误会你