编程介的小学生 2019-03-17 15:06 采纳率: 20.5%
浏览 279

速度和距离关系问题的一个推断算法,采用C编程语言技术实现

Problem Description
One day , Teddy and WhereIsHeroFrom want to pay a visit to their friend yifenfei who are in another city.They own a car ,but the car is so small that it can only contains two people.But both Teddy and WhereIsHeroFrom can't drive a car,so they needs a driver to help them.
Now give you the speed of Teddy and WhereIsHeroFrom , and the speed of the car ,you are asked to worked out the least time Teddy and WhereIsHeroFrom need to spend if they want to reach yifenfei's home at the same time.You may suppose if one gets off the car ,the driver can turn around to carry the other one .

Input
Each line will contain three integers A (0<A<=1000), B(0<B<=10000) and C(0<C<=10^9). A stands for the speed of Teddy and WhereIsHeroFrom ,B stands for the speed of the car,C stands for the distance between the two cities .Process to end of file.

Output
For each case, output the least needed time in one line,accurate to three decimal places.

Sample Input
1 2 1

Sample Output
0.700

  • 写回答

1条回答 默认 最新

  • Yyx_999 2019-03-19 10:51
    关注

    将题目翻译并提出出问题
    特迪和艾瑟罗要去另一个城市的朋友伊芬菲家,但他们只有一辆只能坐两个人的车,且他们两人都不会开车,因此他们需要请一个司机帮忙开车。现在给出特迪和艾瑟罗步行的速度和车的行驶速度和两城市之间距离,特迪和艾瑟罗同时出发,中途先坐车的人下车,司机回头接另一个人,问两人同时到达伊芬菲家所需的最短时间。
    输入
    每一行包含三个整数A(0<A<=1000),B(0<B<=10000) 和C(0<C<=10^9)。A代表特迪和艾瑟罗的速度,B代表车速,C代表两个城市之间的距离。处理到文件末尾。
    输出
    对于每一种情况,在一行中输出所需要的最少时间,精确到小数点后三位。
    例如,输入
    1 2 1
    输出
    0.700

    评论

报告相同问题?

悬赏问题

  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python