第七章作業3

Duanhaifeng55發表於2018-04-08
public static void integral () {
int [] client= new int [] {18,25,7,36,13,2,89,63};
int min=client[0];
int index = 0;
for (int i = 0; i < client.length; i++) {
if(client[i]<min) {
min=client[i];
index = i;
}
}
System.out.println("最小值為:"+min+"\n"+"下標位置為:"+index);
}

相關文章