JoseLargo

Untitled

Dec 6th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. package ejercicio5;
  2.  
  3. import java.util.*;
  4. public class Ejercicio5 {
  5.  
  6.    
  7.     public static void main(String[] args) {
  8.         Scanner sc= new Scanner(System.in);
  9.         int [][] matriz=new int[2][3];
  10.        
  11.         for (int i = 0; i < matriz.length ; i++) {
  12.             for (int j = 0; j < matriz[i].length ; j++) {
  13.                 System.out.println("Introduce dato: ");
  14.                 matriz[i][j]=sc.nextInt();
  15.             }
  16.         }
  17.         System.out.println("La matriz resultante es: ");
  18.         for (int i = 0; i < matriz.length ; i++) {
  19.             System.out.println(" ");
  20.             for (int j = 0; j < matriz[i].length ; j++) {
  21.                 System.out.print(matriz[i][j]+" ");
  22.             }
  23.         }
  24.  
  25.     }
  26.    
  27. }
Add Comment
Please, Sign In to add comment