//创建一个3行5列的二维数组,每个元素的取值范围是[30, 70],求数组中的最大值以及最大值
// 的下标。
int [][] a2 = new int[3][5];
int max = 0,min = 71;
for (int i = 0; i < a2.length; i++) {
for (int j = 0; j < a2[i].length; j++) {
a2[i][j] = random.nextInt(41)+30;
System.out.print(a2[i][j]+" ");
}System.out.println();
}
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 5; j++) {
if(a2[i][j] > max) {
max = a2[i][j];
}
if( a2[i][j] < min ) {
min = a2[i][j];
}
}
}System.out.println("最大值是:"+max);
System.out.println("最小值是:"+min);
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 5; j++) {
if(max == a2 [i][j]) {
System.out.println("最大值的下标是"+i+" "+j);
}
if (min == a2[i][j]) {
System.out.println("最小值的下标是"+i+" "+j);
}
}
}