物理题 好题
开始看题时,就郁闷为什么没有给出速度的方向 原来要求得就是这个角度
公式
v*cos(thta)*t=l;
v*sin(thta)*t-0.5*g*t^2=h;
前式代入后式 得到关于 tan(thta)的一个二元一次方程 h(max)=0.5*v*v/g-0.5*g*l*l/(v*v);
#include<stdio.h>
int main()
{
double h,l,v,g=9.8;
while(scanf("%lf%lf%lf",&h,&l,&v)!=EOF)
{
if(h==0&&l==0&&v==0)return 0;
printf("%.2lf\n",(0.5*v*v/g-0.5*g*l*l/(v*v)+h));
}
return 0;
}