Advertisement
cesarnascimento

matriz incompleto 4x4

May 16th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class fsfsfs {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner sc = new Scanner(System.in);
  8.         int[][] matriz = new int[4][4];
  9.  
  10.         System.out.println("Matriz:");
  11.         for(int l = 0 ; l < 4 ; l++){
  12.             for(int c = 0; c < 4 ; c++){
  13.                 System.out.printf("\t %d \t",matriz[l][c]);
  14.                         if(l == c){
  15.                 System.out.println("1 ");
  16.             }
  17.            
  18.             }
  19.  
  20.         }
  21.  
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement