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 sunwen at 2007-09-04 19:50:46 on Problem 2249
#include<stdio.h>
long f(long n,long m)
{
	if(m==1)return n;
	if(m==0)return 1;
	else
	{
		return (f(n-1,m-1)*n)/m;
	}
}
int main()
{
	long n,m;
	while(scanf("%ld%ld",&n,&m))
	{
		if(n==0&&m==0)
		{
			break;
		}
		else
		{
			if(m>n/2)m=n-m;
			printf("%ld\n",f(n,m));
		}
	}
	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