`
niyayu
  • 浏览: 32390 次
最近访客 更多访客>>
社区版块
存档分类
最新评论

小屁孩很忙(简单数学问题)

 
阅读更多

#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;
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics