Last active
February 11, 2020 06:40
-
-
Save parzibyte/e8f7eb12beb7c72f94dfcbcefda82442 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int[][] matriz = { { 11, 1232, 386, 432 }, { 47, 454, 254, 353 } }; | |
int sumatoria = 0; // Aquí iremos sumando cada valor | |
int cantidadDeElementos = 0; // Contar los elementos | |
// Recorremos la matriz | |
for (int x = 0; x < matriz.length; x++) { | |
for (int y = 0; y < matriz[x].length; y++) { | |
int numeroActual = matriz[x][y]; | |
sumatoria = sumatoria + numeroActual; | |
cantidadDeElementos = cantidadDeElementos + 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment