Home > Back-end >  Recursive implementation of Yang hui triangle (c)
Recursive implementation of Yang hui triangle (c)

Time:06-04

# include & lt; Stdio. H>
Int func (int m, int n)
{
If (n==0 | | n==m)
return 1;
Return func (m - 1, n) + func (m - 1, n - 1);
}
Int main ()
{
Int j, I, j;
M=6;
for(i=0; i<=m; I++)
{
for(j=0; JPrintf (" ");
for(j=0; J<=I; J++)
Printf (" % d "6, func (I, j));
printf("\n");
}
return 0;
}

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related