#include #include using namespace std; int main(int argc, char *argv[]) { int m1[2][3] = {{1, 2, 3}, {4, 5, 6}}; int m2[3][2] = {{1, 2}, {3, 4}, {5, 6}}; int wyn[2][2] = {0}; int i, j, k, s, m, n; for(i = 0; i < 2; ++i) { for(k = 0; k < 2; ++k) { s = 0; for(j = 0; j < 3; ++j) { s += m1[i][j] * m2[j][k]; } wyn[i][k] = s; } } for(m = 0; m < 2; ++m) { for(n = 0; n < 2; ++n) { cout << wyn[m][n] << " "; } cout << endl; } system("PAUSE"); return EXIT_SUCCESS; }