请告诉我下一个问题。我正在尝试将 2 个矩阵相乘,但我的代码中有一些我无法识别的逻辑错误。请帮忙。先感谢您
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
short int Mtx_A[4][2] = {
{1,2},
{3,4},
{5,6},
{7,8},
};
short int Mtx_B[2][3] = {
{5,7,9},
{11,2,6},
};
short int Mtx_res[4][3] = {0};
for (short int i = 0;i<4;i++) { // Mtx_A lines counter
for (short int j=0;j<2;j++) { // Mtx_B lines & Mtx_A columns counter
for (short int k=0;k<3;k++) { // Mtx_res columns counter
Mtx_res[i][k] += Mtx_A[i][j] * Mtx_B[j][k];
cout<< Mtx_res[i][k] <<"*"<<"\t";
}
cout<<"o"<<"\n";
}
}
getchar();
return 0;
}