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

程序改成这样还说错误的啊,wr

Posted by 382784268 at 2008-11-29 16:32:12 on Problem 2249
In Reply To:Re:试试下面这组数据就知道了. Posted by:MasterLuo at 2008-11-29 14:17:19
#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)/i;
			
		}
		
		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