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 wujq at 2008-05-30 20:48:11 on Problem 1003
In Reply To:请高手指教,代码明明正确,但输出是wrong answer Posted by:ET11701233 at 2008-05-30 12:26:27
> #include <iostream>
> using namespace std;
> int main()
> {  
> 	float number,avg=0.0;int n;
> 	cin>>number;
> 	if(number!=0.0&&number>0.01&&number<5.20)
> 	{for(n=1;avg<number;n++)
> 		avg=avg+(float)1/(n+1);
> 		cout<<n-1<<" "<<"card(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