Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created May 1, 2021 18:07
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/d7cacd71908942b91d1f1b02faa0e955 to your computer and use it in GitHub Desktop.
Save parzibyte/d7cacd71908942b91d1f1b02faa0e955 to your computer and use it in GitHub Desktop.
// Primero hacer la suma
int[][] matrizSuma = new int[matriz1.length][matriz1[0].length];
for (int y = 0; y < matriz1.length; y++) {
for (int x = 0; x < matriz1[y].length; x++) {
int numeroMatriz1 = matriz1[y][x];
int numeroMatriz2 = matriz2[y][x];
int suma = numeroMatriz1 + numeroMatriz2;
matrizSuma[y][x] = suma;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment