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 loveqinqin at 2010-07-29 14:28:24 on Problem 2249
#include<stdio.h>
__int64 a,b;
long C(long n,long m)
{
	int i,j;
	a=1;
	b=1;
	if(m>n/2)
		m=n-m;
	for(i=n,j=1;j<=m;i--,j++)
	{
		a*=i;
		b*=j;
		if(a%b==0)
		{
			a/=b;
			b=1;
		}
	}
	return a/b;
}
int main()
{
	long n,m;
	while(scanf("%ld%ld",&n,&m)!=EOF&&n!=0)
	printf("%ld\n",C(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