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

奇怪..为什么用__int64过不了,而用double就AC了,请大牛们帮看下...

Posted by ktty at 2007-08-11 16:47:58 on Problem 1306
#include<stdio.h>
int main()
{
    int M,N,i,j;
    double sum;
    while(scanf("%d%d",&M,&N)!=EOF)
    {
        if(M==0&&N==0) break;
        sum=1;
        for(i=M,j=1;i>=M-N+1;i--,j++)
        {
            sum=sum/j*i;
        }
        printf("%d things taken %d at a time is %.lf exactly.\n",M,N,sum);
    }
    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