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 382784268 at 2008-11-29 14:06:08 on Problem 2249
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	
	int n,k;
	while((cin>>n>>k)&&(n!=0)&&(k!=0))
	{
		double s=1,s1=1;
		int i;

		if(k>n/2)k=n-k;
		for(i=1;i<=k;i++)
		{
			s=s*(n-i+1);
			s1=s1*i;
		}
		s=s/s1;
		cout<<setiosflags(ios::fixed)<<setprecision(0)<<s<<endl;
	}
	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