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

我AC了,大家参考一下

Posted by A861223 at 2006-07-13 00:46:10
#include<stdio.h>
void main()
{ double sum;
  unsigned long i,n,k;
    scanf("%ld %ld",&n,&k);
    while(n!=0)
	{
		sum=1;
		if(k>n/2) k=n-k;
		for( i=1;i<=k;i++)
		{ sum=sum/i;
		  sum=sum*(n-i+1);
		}
		printf("%.0f\n",sum);
		scanf("%ld %ld",&n,&k);
	}
}

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