• 2022-06-08
    从键盘输入20个数,存入一维数组中,求最小值及最小值所有下标。 Scanner sc=new Scanner(System.in);____; for (int i = 0; ____; i++) {System.out.println("请输入第" + (i+1) + "个数:"); num[i] = Integer.parseInt(sc.nextLine()); } int min = num[0]; int index = 0; for (int i = 1; ____; i++){ if (num[i] <;min) { min= num[i]; ____; } } System.out.println("最小值为:" + min + ",下标为:" + index);[/i][/i][/i]