/*
Pattern : 

1
1 2
1 2 3
1 2 3 4

*/



import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j);
                if (j != i) {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: