int[] num = new int[]{5,6,1,4,3,6,7,8,92,6}; int min = num[0]; int n = 0; for (int i = 0; i < num.length; i++) { if(num[i]<min){ min = num[i]; n = i; } } System.out.println("最小數的下标为:" + n);