| ||||||||||
| 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 | |||||||||
大家帮帮忙 为什么 总是compile#include <stdio.h>
int main()
{
float a=0.0,c;
long int i,b,term=1;
while (term>0)
{
scanf("%f",&c);
if(c==0.00)
break;
else if(c>0.00 && c<=0.5)
b=1;
else
{
for(i=2;;i++)
{
a=a+1.0/i;
if(a>c)
break;
b=i;
}
}
printf("%ld\n",b);
term++;
a=0;
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator