Created
January 12, 2017 14:54
-
-
Save LuisFcoOrtiz/fe55921b03acbc0517332b4b76ab8acf to your computer and use it in GitHub Desktop.
Programa Java para Arrays bidimensionales
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
/* | |
* MainArrayBidimensional.java | |
* | |
* Copyright 2017 manrique <https:/github.com/luisFcoOrtiz> | |
* | |
* | |
* | |
*/ | |
public class MainArrayBidimensional { | |
int filas,columnas; | |
public static void main (String args[]) { | |
int m[][] = new int [1000][1000], filas, columnas; | |
System.out.println("Introduce numero de filas: "); | |
filas = EntradaConsola.leeEntero(); | |
System.out.println("Introduce numero de columnas: "); | |
columnas = EntradaConsola.leeEntero(); | |
leerMatriz(m,filas,columnas); | |
imprimirMatriz() | |
}//fin main | |
public static void leerMatriz(int m[][], int filas, int columnas) { | |
for (int i=0; i<filas; i++) { | |
for (int j=0; j<columnas; j++) { | |
System.out.println("Introduce numero: "); | |
m[i][j]=EntradaConsola.leeEntero(); | |
} | |
} | |
}//fin metodo leerMatriz | |
public static void imprimirMatriz(int m[][], int filas, int columnas) { | |
for(int i=0; i<filas ;i++) { | |
for(int j=0; j<columnas; j++) { | |
System.out.print( m[i][j] + " "); | |
} | |
System.out.println("\n"); | |
} | |
}//Fin metodo imprimirMatriz | |
}//fin clase | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment