Advertisement
Guest User

dsa\dsdadsax

a guest
Oct 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class exC {
  3.     public static void main(String[] args) {
  4.         int matriz[][] = new int [3][4];
  5.         int x[3] = new int [3];
  6.  
  7.         for(int j=0; j<3; j++) {
  8.  
  9.             for(int i=0; i<3; i++) {
  10.                 matriz[i][j] = (int)(Math.random()*20);
  11.                 x[i] = x[i] + matriz[i][j];
  12.             }
  13.         }
  14.  
  15.         for(int i=0; i<3; i++) {
  16.  
  17.             for(int j=3; i<3; i++) {
  18.                 matriz[i][j] = x[i];
  19.             }
  20.         }
  21.  
  22.         for(int i=0; i<3; i++) {
  23.  
  24.             for(int j=0; j<4; j++) {
  25.                 System.out.print("["+matriz[i][j]+"]");
  26.  
  27.                 if(j==3) {
  28.                    
  29.                 }
  30.             }
  31.         }
  32.        
  33.        
  34.        
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement