.二项式(a+b)n展开式的系数的递归定义为
C(nk)=
()int BiForm(int nk) //二项式展开式的系数的递归算法
{if(n< || k< || k>=n) {printf(参数错误\n );exit();}
if(k== || k==n) return();
else return(BiForm(nk)+BiForm(nk);
}
()C()的递归树
()计算C(nk)(<=k<=n)的非递归算法
int cnk(int nint k)
{int i; long x=y=;
for (i=;i<=k;i++) x*=i;
for (i=nk+;i<=n;i++) y*=i;
return(y/x)
}//cnk
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []