| ||||||||||
| 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 | |||||||||
where is wrong?#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main()
{
double t,d,l,n,c,r;
double a,b;
while(1)
{
cin>>d>>n>>c;
if(d<0.0||n<0.0||c<0.0)break;
l=(1+n*c)*d/2.0;
d/=2.0;
a=0.0;b=asin(1);
while(b-a>1e-15)
{
t=(a+b)/2;
if(t*d-l*sin(t)>0)b=t;
else a=t;
}
r=l/t;
cout<<fixed<<setprecision(3)<<r-r*cos(t)<<endl;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator