import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { // 标准输入 Scanner input = new Scanner(System.in); // 获取矩阵的规格参数 int x = input.nextInt(); int y = input.nextInt(); int z = input.nextInt(); // 初始化两个矩阵 int[][] matrix1 = new int[x][y]; for (int i = 0; i < x; i++) { for (int j = 0; j < y; j++) { matrix1[i][j] = input.nextInt(); } } // 矩阵1初始化完毕 int[][] matrix2 = new int[y][z]; for (int i = 0; i < y; i++) { for (int j = 0; j < z; j++) { matrix2[i][j] = input.nextInt(); } } // 矩阵2初始化完毕 // 矩阵相乘 int[][] ans = new int[x][z]; for (int i = 0; i < x; i++) { for (int j = 0; j < z; j++) { int temp = 0; for (int k = 0; k < y; k++) { temp += matrix1[i][k] * matrix2[k][j]; } ans[i][j] = temp; } } // 相乘结束 // 输出相乘后的结果 for (int[] row : ans) { for (int num : row) { System.out.print(num + " "); } System.out.println(); } } }