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 |
我彻底疯了,救命,高手看看下面这个程序哪里有问题,我总是WA,谁提供一组测试数据呀#include <stdio.h> main() { __int64 n,k,a,i; while(1) { scanf("%I64d%I64d",&n,&k); if(n==0&&k==0) break; if(k==0||k==n) printf("1\n"); else { if(n-k<k) k=n-k; a=n; for(i=k;i>1;i--) a=a*(n-i+1)/(k-i+2); printf("%I64d\n",a); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator