| ||||||||||
| 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:求大神帮我看一下哪里错了 总是通不过 多谢了In Reply To:Re:求大神帮我看一下哪里错了 总是通不过 多谢了 Posted by:S031002415 at 2012-02-23 15:31:44 #include <stdio.h>
int main ()
{
double x,y;
int i,j=0;
while( (scanf("%lf",&x))==1 && 5.20>=x>=0.00)
{
y=0;
++j;
for(i=1;y<x;i++)
{
y+=1.0/(i+1.0);
}
if(i!=1)
printf("%d card(s)\n",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