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 shaohua2208 at 2009-06-16 09:41:43 on Problem 1942
#include<iostream>
using namespace std;
double com(double m, double n){
	if(n > m - n){
		n = m - n;
	}
	double sum,i;
	sum = 1.0;
	for(i = m; i > m - n; i--){
		sum *= i / (i - m + n);
	}
	return sum;
}
int main(){
	double m, n;
	while(cin>>m>>n){
		if(m == 0.0 && n == 0.0){
			break;
		}
		 printf("%.0lf\n",com(m+n,m));    
	}
	return 0;
}
输出为什么只能用printf %.0lf 用cout(int)就wa  用cout(floor)也是wa

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