如何打印所有这些块?

how to print all these blocks?

我想像 image.I 那样做金字塔可以做第一块。有没有人对如何做到这一点有任何想法?提前致谢。

#include <stdio.h>
int main()
{
    for(int i=0;i<=5;i++)
    {
       for(int j=0;j<=i;j++)
        {
        printf("%d",j);
        }
       printf("\n");

        for(int k=5;j<=k;k--)
       {
        printf("%d",k)
        }
       for(int z=0;z<=5;z++)
        {
        printf("%d",z);
        }
     }



}

i want to do this

#include <stdio.h>

int main(void){
    int n = 5;

    for(int i = 1; i <= n; ++i){//print n lines
        for(int j = 0; j < 2; ++j){//Repeated twice
            //print sequence of number
            for(int k = 1; k <= i; ++k){
                printf("%d", k);
            }
            //print space
            for(int k = 0; k < n - i; ++k){
                printf("  ");//2 times
            }
            //print reverse sequence of number 
            for(int k = i; k >= 1; --k){
                printf("%d", k);
            }
        }
        printf("\n");//one line end
    }
    return 0;
}