Triângulo Floyd em Java

import java.util.*;
class floyd
{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter number of lines: ");
        int num = sc.nextInt();
        int i, j, k = 0;
        for(i = 1; i <= num; i++)
        {
            for(j = 1; j <= i; j++)
            {
                k++;
                System.out.print(k + " ");
            }
            System.out.println();
        }
        sc.close();
    }
}
Poised Parrot