#include<stdio.h>
int yanghui(int m,int n)
{
int r=0;
if(n==1)
return 1;
else
{
r=yanghui(m,n-1)*(m-n+1)/(n-1);
return r;
}
}
int main()
{
int n;
while (scanf("%d",&n)==1){
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
if(j<i)
printf("%d ",yanghui(i,j));
else
printf("%d\n",yanghui(i,j));
}
}
printf("\n");
}
return 0;
}
时间: 2024-12-10 00:17:32