Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:求大牛指点为什么会WA

Posted by 3013216027 at 2015-01-25 09:51:55 on Problem 2249
In 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator