Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:用double不行啊,谁用double AC了 给我看看?In Reply To:用double不行啊,谁用double AC了 给我看看? Posted by:hongxingxiaonan at 2012-06-11 17:20:28 给你看看。 #include <stdio.h> #include <stdlib.h> int main() { int n,k,i; double sum; while(scanf("%d%d",&n,&k),n) { sum=1; if(k>(n>>1)) k=n-k; for(i=k;i>=1;i--,n--) sum*=(n*1.0/i); printf("%.0f\n", sum); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator