int main(){
int n;
scanf("%d",&n);
int a[n][n];
for(int i=0;i<n;i++){
printf("%*d",n+3-i,a[i][0]=1);
for(int j=1;j<=i;j++){
if(i==j)
a[i][j]=1;
else
a[i][j]=a[i-1][j-1]+a[i-1][j];
printf("%4d",a[i][j]);
}
printf("\n");
}
return 0;
}
时间: 2024-10-12 14:37:11