poj 1905Expanding Rods

 /*
二分 + 几何
弧长L, 圆半径R, 弧度 q, L=R*q;
二分: 弧度(0~PI) 或者 高度(L/2~L)
*/
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
const double PI = acos(-1.0);
double L, L1, T, C, R, Q; int main(){ while(scanf("%lf%lf%lf", &L, &T, &C) && (L!=- || T!=- || C!=-)){
L1 = (+T*C)*L;
double ld=0.0, rd=PI, tmp;
Q = (ld+rd)/;
R = L//sin(Q);
while(fabs(tmp = R**Q-L1)>1e-){
if(tmp>) rd=Q;
else ld=Q;
Q=(ld+rd)/;
R = L//sin(Q);
}
printf("%.3lf\n", R-sqrt(R*R - (L/)*(L/)));
}
return ;
}
上一篇:oracle数据库无法连接 The Network Adapter could not establish


下一篇:转:入门Webpack,看这篇就够了