| ||||||||||
| 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 | |||||||||
HELP!为什么官方测试数据过了。。。还是wa.请大牛们帮我看看。。先感谢一下!!!#include<iostream>
#include <cstdio>
#include<iomanip>
#include<cmath>
#define PI 3.1415926535897932384626433832795028
using namespace std;
int main()
{
//freopen("ans.txt","w",stdout);
//freopen("1.dat","r",stdin);
double l1,c,n,l,ang0(0),ang1,biang,tmp,ang,R,h;
while(cin>>l1&&l1>=0)
{
cin>>n>>c;
if(n==0.00||c==0.00||l1==0.00)
{
printf("%.3f\n",0);
continue;
}
l=(1+n*c)*l1;
ang0=0;
ang1=6*PI/7;
ang=ang1;
tmp=l1/l;
while(abs(ang1-ang0)>0.00000000000001)
{
ang=(ang0+ang1)/2;
biang=sin(ang)/ang;
if(biang>tmp)ang0=ang;
else ang1=ang;
}
printf("%.3f\n",l/ang*0.5*(1-cos(ang)));
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator