本文主要是介绍6kyu Tank Truck,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
6kyu Tank Truck
文章目录
- 6kyu Tank Truck
- Problem
- Examples
- Solutions
- Tips
Problem
To introduce the problem think to my neighbor who drives a tanker truck. The level indicator is down and he is worried because he does not know if he will be able to make deliveries. We put the truck on a horizontal ground and measured the height of the liquid in the tank.
Fortunately the tank is a perfect cylinder and the vertical walls on each end are flat. The height of the remaining liquid is h
, the diameter of the cylinder is d
, the total volume is vt
(h, d, vt are positive or null integers). You can assume that h
<= d
.
Could you calculate the remaining volume of the liquid? Your function tankvol(h, d, vt)
returns an integer which is the truncated result (e.g floor) of your float calculation.
Examples
tankvol(40,120,3500) should return 1021 (calculation gives about: 1021.26992027)tankvol(60,120
这篇关于6kyu Tank Truck的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!