public static void main(String[] args) {
System.out.println("Ejemplo matriz de 3x3");
System.out.println();
int[][] matrix = {{1,2,3},{4,5,6},{7,8,9}};
for(int row = 0; row < 3; row++){
for(int col = 0; col < 3; col++)
System.out.print(matrix[row][col] + " ");
System.out.println();
}
System.out.println();
System.out.println("Ingresar numero");
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
sc.close();
for(int row = 0; row < 3; row++){
for(int col = 0; col < 3; col++) {
if(matrix[row][col] == x) {
System.out.println("las coordenadas son:");
System.out.println("row: "+row);
System.out.println("col: "+col);
}
}
}
}