杭电2032,杨辉三角问题,不知道为什么通不过,请帮忙看看指错,谢啦
#include<stdio.h>int main()
{
int n, i, j;
while(scanf("%d", &n) == 1)
{
if(!n)
continue;
int a[30][30];
for(i = 0;i < n;i++)
{
for(j = 1, a[i][0] = 1, a[i][i] = 1 ;j < i;j++)
{
a[i][j] = a[i - 1][j] + a[i - 1][j - 1];
}
}
for(i = 0; i < n;i++)
{
for(j = 0;j <= i;j++)
{
if(j == 0)
printf("%d", a[i][j]);
else
printf(" %d", a[i][j]);
}
printf("\n");
}
printf("\n");
}
return 0;
}