标签:code ima while enter turn printf mic amp include
#include <stdio.h>
int main()
{
int i,j;
int n,a[100][100]={0};
while(n<1||n>99){
printf("Enter n(0<n<100):");
scanf("%d",&n);
}
for(i=0;i<n;i++)
a[i][0]=1;
for(i=1;i<n;i++)
for(j=1;j<n;j++)
a[i][j]=a[i-1][j-1]+a[i-1][j];
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
printf("%4d",a[i][j]);
printf("\n");
}
return 0;
}
标签:code ima while enter turn printf mic amp include
原文地址:https://www.cnblogs.com/zhushengping/p/11006920.html