Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.33 KB | None | 0 0
  1. package basicos10matrices;
  2.  
  3. public class Basicos10matrices {
  4.  
  5.    
  6.     public static void main(String[] args) {
  7.         /* Muestra por pantalla el array bidimensional que creaste
  8.         en el ejercicio anterior. */
  9.        
  10.         int[][] matriz = {{1,2,3,4,5,},{6,7,8,9,10},{11,12,13,14,15}};
  11.        
  12.         for(int i = 0; i < matriz.length;i++){
  13.             for(int j = 0; j < matriz[i].length;j++){
  14.                 System.out.print(matriz[i][j] + " ");
  15.             }
  16.             System.out.println("");
  17.         }
  18.        
  19.         /* Muestra por pantalla el elemento que se encuentra en la fila 0 columna 3. */
  20.         for(int i = 0; i < matriz.length;i++){
  21.             for(int j = 0; j < matriz[i].length;j++){
  22.             }
  23.         }
  24.         System.out.print(matriz[0][3] + " ");
  25.         /* Muestra por pantalla el elemento que se encuentra en la fila 1 columna 2. */
  26.         for(int i = 0; i < matriz.length;i++){
  27.             for(int j = 0; j < matriz[i].length;j++){
  28.             }
  29.         }
  30.          System.out.print(matriz[1][2] + " ");
  31.         /* Muestra por pantalla el elemento que se encuentra en la fila 2 columna 4. */
  32.         for(int i = 0; i < matriz.length;i++){
  33.             for(int j = 0; j < matriz[i].length;j++){
  34.             }
  35.         }
  36.         System.out.print(matriz[2][4] + " ");
  37.     }
  38.    
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement