首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

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

2012-09-08 
小屁孩很忙(简单数学问题)#includestdio.h#includemath.hint main(){?double v,d,a,t1,t2,w?while(sc

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

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

热点排行