Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 11, 2019 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/c70c95e2136d4acb4331065b91330e73 to your computer and use it in GitHub Desktop.
Save parzibyte/c70c95e2136d4acb4331065b91330e73 to your computer and use it in GitHub Desktop.
// Necesitamos hacer esto por cada columna de la segunda matriz (B)
for (int a = 0; a < COLUMNAS_MATRIZ_B; a++) {
// Dentro recorremos las filas de la primera (A)
for (int i = 0; i < FILAS_MATRIZ_A; i++) {
int suma = 0;
// Y cada columna de la primera (A)
for (int j = 0; j < COLUMNAS_MATRIZ_A; j++) {
// Multiplicamos y sumamos resultado
suma += matrizA[i][j] * matrizB[j][a];
}
// Lo acomodamos dentro del producto
producto[i][a] = suma;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment