import java.util.Scanner; public class Demo4{ public static void main(String[] args) { int[] array = {7,1,10,8,9}; int index = 0;//保存的是最小值对应的下标 for(int i=0;i<array.length;i++){ if(array[index]>array[i]){ index = i; } } System.out.println(index+":"+array[index]); } }