| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:C++一直WA的注意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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator