2020-06-19数组乘积

#include 
using namespace std;
int main()
{
    const int m = 3, k = 2, n = 4;
    int a[m][k] = { 1,2,3,4,5,6 };
    int b[k][n] = { 1,0,1,1,0,1,0,1 };
    int c[m][n] = { 0 };
    for (int i = 0; i < m; i++)
            for (int j = 0; j < n; j++)
                for (int t = 0; t < k; t++)
                    c[i][j] = c[i][j] + a[i][t] * b[t][j];
        for (int i = 0; i < m; i++)
        {
            for (int j = 0; j< n; j++)
                cout << c[i][j]<<"  ";
        }
        int j = 0;
        cin >> j;
}

你可能感兴趣的:(2020-06-19数组乘积)