代码文本:include "stdio.h"int myfact(int n){ return n>1 ? n*myfact(n-1) : 1;} int main(int argc,char *argv[]){ int i,s;for(s=0,i=1;i<6;s+=myfact(i++));printf("1!+2!+3!+4!+5! = %d\n",s);return 0;} ...
int comb(int n, int m){ return fac(m)/ (fac(n) * fac(m-n));} int fac(int n){ int result=1,i;for (i=1;i<=n;i++)result *= i;return result;}