int[] x = new int[6]; Scanner scan = new Scanner(system.in); for(i=0;i<x.length;i++){ System.out.println("请输入x数组的第"+(i+1)+"个值:"); x[i]=scan.nextInt(); }