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:求大牛指点为什么会WAIn Reply To:求大牛指点为什么会WA Posted by:lllidan at 2011-02-13 00:12:29 样例: 30 14 0 0 输出: 145422675 > #include<stdio.h> > > int main() > { > int n,k,i,w,t; > _int64 a,b; > > scanf("%d%d",&n,&k); > while(1) > { > if ((n==0)&&(k==0)) break; > a=1; > b=1; > if (k>(n/2)) > k=n-k; > for (i=n;i>=n-k+1;i--) > a*=i; > for (i=2;i<=k;i++) > b*=i; > printf("%I64d\n",a/b); > scanf("%d%d",&n,&k); > } > > return 0; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator