| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:请高手指教,代码明明正确,但输出是wrong answerIn 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator