#include<stdio.h>
int main(){
int n = 0;
scanf("%d", &n);
int** t;
t = (int**)malloc(sizeof(int*)* n);
for (int i = 0; i < n; i++) {
t[i] = (int*)malloc(sizeof(int)* n);
}
//创建初始矩阵(n=4)
//1 0 0 0
//1 0 0 0
//1 0 0 0
//1 0 0 0
for (int j = 0; j < n; j++) {
t[j][0] = 1;//第一列都初始化为1
for (int k = 1; k < n; k++) {//其余初始化为0
t[j][k] = 0;
}
}
for (int i = 1; i < n; i++) {//计算除第一列第一行以外的数
for (int j = 1; j < n; j++) {
t[i][j] = t[i - 1][j - 1] + t[i - 1][j];//当前数等于上一行数字与上一行数字前一位数字之和
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (t[i][j]) {//不为0即打印
printf("%5d", t[i][j]);
}
}
printf("\n");
}
for(int i=0;i<n;i++)
free(t[i]);
free(t);
return 0;
}