输出杨辉三角前10行

#include<stdio.h> main() { int a[10][10]; int i,j; for(i=0;i<10;i++) for(j=0;j<10;j++) if(j==0) { a[i][j]=1; else a[i][j]=a[i-1][j-1]+a[i-1][j]; printf("%5d",a[i][j]); } }运行提示错误是在else后面,想不出错哪里了
#include<stdio.h> main() { int a[10][10]; int i,j; for(i=0;i<10;i++) for(j=0;j<10;j++) if(j==0) { a[i][j]=1; else a[i][j]=a[i-1][j-1]+a[i-1][j]; printf("%5d",a[i][j]); } }运行提示错误是在else后面,想不出错哪里了