// 7. Display the pattern:
//            1
//          1 2
//        1 2 3
//      1 2 3 4
//    1 2 3 4 5
#include <stdio.h>

int main() {
    int rows = 5;

    for (int i = 1; i <= rows; i++) {
        // leading spaces so each row lines up on the right
        for (int s = 1; s <= rows - i; s++) {
            printf("  ");
        }
        // numbers 1 to i
        for (int j = 1; j <= i; j++) {
            printf("%d ", j);
        }
        printf("\n");
    }

    return 0;
}
