编辑代码

#include <stdio.h>

void printNumbers(int current, int n) {
    if (current > n) return;
    
    for (int i = 0; i < current; i++) {
        printf("%d ", current);
    }
    printf("\n");
    
    printNumbers(current + 1, n);
}

int main() {
    int n = 6; 
    printNumbers(1, n);
    return 0;
}