| ||||||||||
| 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 | |||||||||
为什么我的程式老是wrong answer?想不明白啊#include<stdio.h>
#include<math.h>
#define pi 3.14159
double rad(double x,double y)
{
double s;
for(s=0;;s=s+0.0001)
if(pow(s,y)>x)
break;
return s;
}
main()
{
double D,d,v,i,j,s;
while(scanf("%lf%lf",&D,&v)&&D||v)
{
if(v>pow(D,3)*pi/4) break;
s=pow(D,3)-(6*v/pi);
d=rad(s,3);
printf("%.3lf\n",d);
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator