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

求大牛指点为什么会WA

Posted by lllidan at 2011-02-13 00:12:29 on Problem 2249
#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