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

Re:兄弟门,帮帮菜鸟啊,怎么wrong answer

Posted by Sunnyshine at 2006-03-06 16:34:48 on Problem 1003
In Reply To:兄弟门,帮帮菜鸟啊,怎么wrong answer Posted by:Tim at 2006-02-19 17:13:16
> #include<iostream>
> using namespace std;
> 
> int number(float f)
> {
> 	int i=1;
> 	float s=0;
> 	while(s<=f)
> 	{
> 		i++;
> 		s+=1.0/i;
> 	}
> 	return i-1;
> }
> 
> int main()
> {
> 	int j=0,i=0;
> 	float h;
> 	while(1)
> 	{
> 		cin>>h;
> 		if(h==0.00)
> 			break;
> 		cout<<number(h)<<" card(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