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 starkerry at 2011-02-12 10:47:15 on Problem 1942
#include <iostream>
using namespace std;
int main ()
{
	double n,m;
	while (scanf("%lf%lf",&n,&m)!=EOF)
	{
		if(n==0&&m==0)
			break;
		double x,y,ans=1.0;
		x=n<m? n:m;
		y=n>m? n:m;
		int i=0;
		for (i=y+x;i>=y+1;i--)
		{
			ans=ans*i;
		}
		double s=1.0;
		int j=0;
		for (j=x;j>=1.0;j--)
		{
			s=s*j;
		}
		printf("%.0lf\n",ans/s);
	}
	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