小屁孩很忙(简单数学有关问题)
小屁孩很忙(简单数学问题)
#include<stdio.h>
#include<math.h>
int main()
{
double v,d,a,t1,t2,w;
while(scanf("%lf %lf %lf",&v,&d,&a)!=EOF)
{
t1=0;
t2=0;
w=v*v-2*a*d;
if(w>0)
{
t1=(v+sqrt(w))/a;
t2=(v-sqrt(w))/a;
if(t2>0)
printf("%.2f\n",t2);
else
printf("%.2f\n",t1);
}
else
printf("wo zai ye bu zuo huoche le!\n");
}
return 0;
}