编程介的小学生 2017-06-06 16:41 采纳率: 20.5%
浏览 646
已采纳

Who will be the HDU-START tonight?

Problem Description

Here goes the Problem:

As the picture shown above, there is funnel upside the container. You can assume the bottom of the container is a square. Initially, there are some water in the funnel, the funnel's bottom diameter is x, y stands for the top diameter of the water. Z means the height of the water. The container's height is h, and its bottom is a d*d size square.
The question is: when all the water in the funnel has leaked out, what's the height of the water in the container?
Tips: The Volume of a frustum of a cone(圆台) is:,s1 and s2 are the area of the 2 faces, and H is the height.

Input
There will be multiple input sets. Input for each set is five positive integers x, y, z, h and d(x<y, 1<=x, y, z, h, d <= 10000) . The final input set is followed by a line containing five 0s, indicating end of input.

Output
Output for each input set should be one line, containing a number H, the height of the water in the container, accurate up to 3 decimal places.

Sample Input
1 2 1 3 3
0 0 0 0 0

Sample Output
0.204

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-06-07 15:47
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用