谁能帮我解决这题
已知A是一个3×4的矩阵,B是一个4×5的矩阵,编写程序,从键盘输入A,B的值,求A×B得到的新矩阵C,并输出矩阵C
程序代码://貌似应该是这样写的
#include "stdio.h"
int main()
{
int a, b, k, A_Rows, A_Columns, B_Rows, B_Columns, C_Rows, C_Columns, Matrix_A[3][4], Matrix_B[4][5], Matrix_C[3][5];
printf("请输入矩阵A的值:\n");
for(A_Rows = 0; A_Rows < 3; A_Rows++)
{
for(A_Columns = 0; A_Columns < 4; A_Columns++)
{
scanf("%d", &Matrix_A[A_Rows][A_Columns]);
}
}
printf("请输入矩阵B的值:\n");
for(B_Rows = 0; B_Rows < 4; B_Rows++)
{
for(B_Columns = 0; B_Columns < 5; B_Columns++)
{
scanf("%d", &Matrix_B[B_Rows][B_Columns]);
}
}
for(C_Rows = 0; C_Rows < 3; C_Rows++)
{
for(C_Columns = 0; C_Columns < 5; C_Columns++)
{
Matrix_C[C_Rows][C_Columns] = 0;
for(k = 0; k < 4; k++)
{
Matrix_C[C_Rows][C_Columns] = Matrix_C[C_Rows][C_Columns] + Matrix_A[C_Rows][k] * Matrix_B[k][C_Columns];
}
}
}
printf("矩阵C的值为:\n");
for(C_Rows = 0; C_Rows < 3; C_Rows++)
{
for(C_Columns = 0; C_Columns < 5; C_Columns++)
{
printf("%-4d",Matrix_C[C_Rows][C_Columns]);
}
putchar('\n');
}
fflush(stdin);
getchar();
}







我是把一半的都列出来 然后找规律的


怎么有点眼熟?