标签:span oss roc otherwise log math printf script ber
#include<cstdio> #include<cmath> #include<iostream> #define PI 3.14159 using namespace std; double x,y,l,d; double pd(double a) { return sin(a)*l+d/cos(a)-y*tan(a); } int main() { while(scanf("%lf%lf%lf%lf",&x,&y,&l,&d)!=EOF) { double lm,rm,le=0.0,r=PI/2; while(fabs(r-le)>1e-6) { lm=(le*2.0+r)/3.0; rm=(le+r*2.0)/3.0; if(pd(lm)>pd(rm)) r=rm; else le=lm; } if(pd(le)<=y) printf("yes\n"); else printf("no\n"); } }
标签:span oss roc otherwise log math printf script ber
原文地址:http://www.cnblogs.com/rir1715/p/6816027.html