/*
  Copyright (c) October 2013 by Paweł Rzechonek
*/

public class TriangArray
{
    public static void main (String[] args)
    {
        // declaration of 2D array
        int tab[][];
        // creation of array
        tab = new int[(int)(Math.random()*10)][];
        // creation of subarrays
        for (int i=0; i<tab.length; i++)
            tab[i] = new int[i];
        // fill the 2D array of random values from the range 10...99
        for (int i=0; i<tab.length; i++)
            for (int j=0; j<tab[i].length; j++)
                tab[i][j] = (int)(Math.random()*90+10);
        // print 2D array
        for (int i=0; i<tab.length; i++)
        {
            for (int j=0; j<tab[i].length; j++)
                System.out.print(" "+tab[i][j]);
            System.out.println();
        }
    }
}

