摘要: #includeint main(void){ int m,n,i; float x,y,z,p; printf("Enter n(n>0) and m(m>0)\n"); scanf("%d%d",&m,&n); x=1; y=1; for(i=1;i<=n;i++){ x=x*i; } for(i=1;i<=m;i++){ y=y*i; } z=y-x; for(i=1;i<=m-n;i++){ z=z*i; } p=y/x*y/z; printf("p=%.... 阅读全文
posted @ 2013-10-21 09:39 shadowtly 阅读(114) 评论(1) 推荐(0)
摘要: #includedouble fact(int n);int main(void){ int i,n; double x; printf("Enter n:"); scanf("%d",&n); x=0; for(i=1;i<=n;i++) x=x+fact(i); printf("1!+2!+3!+...100!=%e\n",x); return 0;}double fact(int n){ int i; double y; y=1; for(i=1;i<=n;i++) y=y*1; r... 阅读全文
posted @ 2013-10-21 09:19 shadowtly 阅读(129) 评论(0) 推荐(0)