#include
#include
#define N 10
int main(int argc, char *argv[])
{int i,j;
int a[N][N] = {0};
for (i = 0; i < N; i++)
{
a[i][0] = 1;
printf("%3d ",a[i][0]);
for (j = 1; j <= i; j++)
{
if (i == j ||j == 0){a[i][j] = 1;}
else {a[i][j]= a[i-1][j-1] + a[i-1][j];}
printf("%3d ",a[i][j]);
}
printf("\n");
}
system("pause");
return 0;
}