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

那位大婶帮忙看一下是啥子故障嘛。。。。

Posted by zhuhaiwen at 2009-05-12 17:01:59 on Problem 2249
#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);
    }
}
      
      
    
    

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