摘要: #includeint main(){ int m,n,count; int isprime(int m); printf("enter m and n(mm/2&&m!=1) result=m; return result;} 阅读全文
posted @ 2013-10-21 10:00 执于一念 阅读(622) 评论(1) 推荐(0) 编辑
摘要: #includeint main(){ int m,n; float result,sum; float fact(int n); printf("enter m and n:"); scanf("%d%d",&m,&n); sum=fact(m-n); result=fact(m)/(fact(n)*sum); printf("result=%.0f\n",result); return 0;}float fact(int n){ int i; float result; result=1; for(i=1;i< 阅读全文
posted @ 2013-10-21 09:16 执于一念 阅读(124) 评论(0) 推荐(0) 编辑
摘要: #includeint main(){ int i,n,sum; int fact(int n); sum=0; n=100; for(i=1;i<=n;i++){ sum=sum+fact(i); } printf("1!+2!+...+100!=%d\n",sum); return 0;}int fact(int n){ int i; double result; result=1; for(i=1;i<=n;i++){ result=result*i; } return res... 阅读全文
posted @ 2013-10-21 09:15 执于一念 阅读(418) 评论(0) 推荐(0) 编辑