Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class contarColumnasConCeros {
- public int contarColumnas(double[][] matriz) {
- int cantidadDeColumnasConCeros = 0;
- for (int i = 0; i < matriz.length; i++) {
- int contador = 0;
- for (int j = 0; j < matriz[i].length; j++) {
- if (matriz[i][j] == 0) {
- contador++;
- }
- }
- if (contador > 0) {
- cantidadDeColumnasConCeros++;
- }
- }
- return cantidadDeColumnasConCeros;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement