pku2507.cpp
来自「这是ACM 方面的资料 是PKU的 北京大学的出来的」· C++ 代码 · 共 24 行
CPP
24 行
#include <stdio.h>
#include <math.h>
int main()
{
double x,y,d,c,c0,min,max,tempx,tempy,temp;
while(scanf("%lf%lf%lf",&x,&y,&c0)!=-1)
{
max=(x<y)?x:y;
min=0;
while(max-min>1e-4)
{
temp=(min+max)/2;
tempx=sqrt(x*x-temp*temp);
tempy=sqrt(y*y-temp*temp);
c=tempx*tempy/(tempx+tempy);
if(c<c0) max=temp;
else min=temp;
}
printf("%.3f\n",temp);
}
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?