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

请帮我看看这个程序为啥w

Posted by k880331 at 2009-07-30 14:29:25 on Problem 2249
#include<stdio.h>
int main()
{
	__int64 s1,s2,s, k,i,j,n;

	while(scanf("%I64d%I64d",&n,&k)&&n!=0&&k!=0)
	{
		s1=1;s2=1;s=1;
		if(k==0||k==n) 
			printf("1\n");
		

		if(k>n/2)
			k=n-k;
		i=0;j=k;
		while(i<k)
		{
			s1*=n;
			if(s1%j==0)
				s1=s1/j;
			else
				s2*=j;
			i++;
			j--;
			n--;
			
				//printf("%I64d%I64d\n",s1,s2);


		}
		s=s1/s2;
		printf("%I64d\n",s);

		
		

	}
	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