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:C++一直WA的注意

Posted by lmq1984 at 2012-10-15 02:07:30 on Problem 1942
In Reply To:C++一直WA的注意 Posted by:ouwery at 2012-04-04 15:51:08
为啥一直WA????
#include <iostream>

using namespace std;


int main()
{
	long long m,n,tmp,sum=1;

	while(cin>>m>>n,m+n!=0)
	{
		if(m==0||n==0){cout<<1<<endl;continue;}
	   if(m<n) { tmp=m;n=m;m=tmp;}
		sum=1;
	   for(long long i=1;i<=n;i++)
                 sum=sum*(i+m)/i;
		cout<<sum<<endl;
	}
	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