public class p2t2p6{
public static void main(String[] args){
int[][] mat = new int[3][5];
for(int i = 0; i < mat.length; i++)
for (int j = 0; j < mat[i].length; j++)
mat[i][j] = (i+1)*10 + (j+1);
for(int i = 0; i<mat.length; i++) {
for (int j = 0; j < mat[i].length; j++)
System.out.print(mat[i][j]+ " ");
System.out.println();} }}
que produeix la sortida:
11 12 13 14 15 21 22 23 24 25 31 32 33 34 35