import java.util.Scanner;
public class TestArray {
public static void main(String[] args) {
int nums[][] = new int[3][4];
Scanner scanner = new Scanner(System.in);
System.out.println("请输入数字:");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 4; j++) {
try{
int tmpInt = scanner.nextInt();
nums[i][j] = tmpInt;
}catch (Exception e) {
System.out.println("输入的不是数字,请重新输入!");
scanner.nextLine();
j--;
}
}
System.out.println("第"+(i+1)+"行输入完毕");
}
int max = nums[0][0];
int x=0;
int y=0;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 4; j++) {
if(nums[i][j]>max){
max = nums[i][j];
x = i;
y = j;
}
}
}
System.out.println("最大值为:"+max+",行下标为:"+x+", 列下标为:"+y);
}
}