分享一波杨辉三角的解决办法
作者:互联网
int main()
{
int a[5][5] = { 0 },i,j;
for (i = 0; i < 5; i++)
{
a[i][0] = 1;
for (j = 0; j <= i; j++)
{
if (j >= 1)
{
a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
}
printf("%d ", a[i][j]);
}
printf("\n");
}
return 0;
}
标签:一波,解决办法,return,int,++,printf,杨辉三角,main 来源: https://blog.csdn.net/qq_53518987/article/details/121179838