资源预览内容
第1页 / 共4页
第2页 / 共4页
第3页 / 共4页
第4页 / 共4页
亲,该文档总共4页全部预览完了,如果喜欢就下载吧!
资源描述
(5)#includelong fib(int n)long f;if(n=0|n=1)if(n=0)f=0;else f=1;else f=fib(n-1)+fib(n-2);return f;main()long y;int n;scanf(%d,&n);y=fib(n);printf(%ld,y);00Press any key to continue11Press any key to continue821Press any key to continue(6)#includelong fac(int n)long f;if(n=1) f=1;else f=n*fac(n-1);return f;long comb(int n,int m)int t=0;long c;t=m+n;c=fac(t)+fac(n);return c;main()long c;int n,m;scanf(%d,%d,&n,&m);c=comb(n,m);printf(%ld,c);2,18Press any key to continue(10)#includedouble fac(double n)double f;if(n=0) f=1;else f=n*fac(n-1);return f;double fab(double x,double n)double t=1;double i=0;if(i=0)return 1;elsefor(i=1;i=n;i+)t=t*x;return t;double fad(double n)double g;if (n=0)g=1;else g=-1*fad(n-1);return g;double comb(double x,double n)double c;c=fad(n)*fab(2*n)/fac(2*n);return c;double combl(double x,double n)double e;e=comb(x,n)/(combl(x+2.3)+combl(x-3.2,n+3)return e;main()double x,n,e;scanf(%f,%f,&x,&n);e=combl(x,n);printf(%f,e);(8)#includedouble fac(double n)double f;if(n=0) f=1;else f=n*fac(n-1);return f;double fab(double x,double n)double t=1;double i=0;if(i=0)return 1;elsefor(i=1;i=n;i+)t=t*x;return t;double fad(double n)double g;if (n=0)g=1;else g=-1*fad(n-1);return g;double comb(double x,double n)double c;c=fad(n)*fab(2*n)/fac(2*n);return c;double combl(double x,double n)double e;e=comb(x,n)/(combl(x+2.3)+combl(x-3.2,n+3)return e;main()double x,n,e;scanf(%f,%f,&x,&n);e=combl(x,n);printf(%f,e);
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号