| ||||||||||
| 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 answer?In Reply To:请高手来看看,为什么这个总是wrong answer? Posted by:yelin at 2009-03-05 16:47:40 > #include<stdio.h>
> int main()
> {
> double i=1;
> double len,sum=0;
> scanf("%lf",&len);
> if(len>=0.01&&len<=5.20)
> {
> while(sum<=len)
> {
> i++;
> sum=sum+(1/i);
> }
> printf("%d card(s)\n",(int)(i-1));
> }
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator