mauroslucios

Matriz_4x4

Apr 29th, 2017 (edited)
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. package br.com.aulas;
  2. import java.util.Scanner;
  3. public class Matriz_4x4 {
  4.  
  5.     public static void main(String[] args){
  6.       int l,c;  
  7.       int mat[][] = new int[4][4];    
  8.       Scanner entrada = new Scanner(System.in);
  9.      
  10.       for(l = 0;l <= 3;l++){
  11.           for(c = 0; c <= 3; c++){
  12.               System.out.print("Entre com o valor ["+l+":"+c+"]:");
  13.               mat[l][c] = entrada.nextInt();
  14.            }
  15.          
  16.       }
  17.      
  18.       System.out.println("---MATRIZ 4x4---");
  19.      
  20.       for(l = 0; l <= 3 ; l++){
  21.         for(c = 0; c <= 3 ; c++){
  22.             System.out.print(mat[l][c]+"");
  23.         }
  24.                 System.out.println("");
  25.       }
  26.     }
  27. }
Add Comment
Please, Sign In to add comment