#include <stdio.h>
#define limit 16
#define N 15

void  CaculateYH(long a[][N], int  n);
void  PrintYH(long a[][N], int  n);
int main()
{
    int n;
    long a[limit][N];
    printf("Input n(n<15):\n");
    scanf("%d",&n);
    while (n>=15)
    {
        printf("Input n(n<15):\n");
        scanf("%d",&n);
    }
    CaculateYH(a, n);
    PrintYH(a, n);
    return 0;
}

void  CaculateYH(long a[][N], int  n)
{
    int i,j,p,q,count;
    long c;
    for (i=1;i<=n;i++)
    {
        for (j=1;j<=i;j++)
        {
            if (i==j || j==1 || i==1)
            {
                a[i][j]=1;
            }
            else
            {
                c=1;
                for(p=i-1,count=1;count<=j-1;p--,count++)
                {
                    c=c*p;
                }
                for (q=j-1;q>=1;q--)
                {
                    c=c/q;
                }
                a[i][j]=c;
            }
        }
    }
}

void  PrintYH(long a[][N], int  n)
{
    int i,j;
    for (i=1;i<=n;i++)
    {
        for (j=1;j<=i;j++)
        {
            printf("%ld\t",a[i][j]);
        }
        printf("\n");
    }
}