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:为什么这样还不过?

Posted by cpp050800448144 at 2005-04-25 21:28:03 on Problem 2249
In Reply To:Re:为什么这样还不过? Posted by:00448067 at 2005-04-25 21:01:33
> 我也老是WA
> #include <iostream.h>
> double cc(double m,double n)
> {   if(m<0 || n<0 || m<n) return 0;
> 	if(m==n) return 1;
> 	if(n==1) return m;
> 	else return ( cc(m-1,n)+cc(m-1,n-1) );
> }
> void main()
> {
>          double m,n;
> 	cin >> m >> n;
> 	while(m!=0 && n!=0)
> 	{ 
> 	  cout << (unsigned long)cc(m,n) << endl;
> 	  cin >> m >> n;
> 	}
> }

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