Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ejercicio5;
- import java.util.*;
- public class Ejercicio5 {
- public static void main(String[] args) {
- Scanner sc= new Scanner(System.in);
- int [][] matriz=new int[2][3];
- for (int i = 0; i < matriz.length ; i++) {
- for (int j = 0; j < matriz[i].length ; j++) {
- System.out.println("Introduce dato: ");
- matriz[i][j]=sc.nextInt();
- }
- }
- System.out.println("La matriz resultante es: ");
- for (int i = 0; i < matriz.length ; i++) {
- System.out.println(" ");
- for (int j = 0; j < matriz[i].length ; j++) {
- System.out.print(matriz[i][j]+" ");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment