public static void main(String[] args) { // TODO Auto-generated method stub int integarl [] = new int []{18,25,7,36,13,2,89,63}; int min=integarl[0],index=0; for (int i = 0; i < integarl.length; i++) { if(integarl[i]<min){ min=integarl[i]; index=i+1; } } System.out.println(min+" "+index); } }
java-第七章-数组-一组数字找出最低分,并找出他的下标
时间: 2024-11-11 08:08:27