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:那位大婶帮忙看一下是啥子故障嘛。。。。

Posted by cigaring at 2010-11-27 22:40:45 on Problem 2249
In Reply To:那位大婶帮忙看一下是啥子故障嘛。。。。 Posted by:zhuhaiwen at 2009-05-12 17:01:59
> #include <iostream>
> using namespace std;
> int main()
> {
>     long long n,k;
>     while(cin>>n>>k)
>     {
>       if(n==0&&k==0)
>        break;
>       __int64 answer=1;
>       __int64 mol=1;
>       __int64 den=1;
>       if(k==0||k==n)
>          ;
>       else
>       {
>        if(k>n/2)
>          k=n-k;
>        for(int i=0;i<k;++i)
>        {
>               mol*=(n-i);
>               den*=(i+1);
>        }
>        answer=mol/den;
>       }
>       printf("%I64d\n",answer);
>     }
> }

   我貼了你的代碼,把__int64改成double ,最後輸出時候再把double改正__int64就可以了。不信你用你的代碼隨便十一足數據,比如40 20。
>       
>       
>     
>     

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