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

偶的超短的程序,比程序大小没意思

Posted by gemenhao at 2006-02-27 21:00:57 on Problem 1942
#include<iostream.h>
typedef long long l64;
l64 Cnm(l64 n,l64 m)
{		  
	 return m>0?(Cnm(n-1,m-1)*n)/m:1;
}
 int main()
{			 
	 l64 m,n;
	 while(cin>>n>>m&&m+n>0)
		 cout<<Cnm(m+n,(m<n)?m:n)<<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