作业帮 > 英语 > 作业

英语翻译Once a gasoline meter broke at a filling station.Fortuna

来源:学生作业帮 编辑:作业帮 分类:英语作业 时间:2024/05/17 00:10:50
英语翻译
Once a gasoline meter broke at a filling station.Fortunately,there was an overflow clipper (a device that makes it possible not to overfill a tank).
An ACM-programmer came to this station and saw an announcement saying that the station didn't work properly.As he was meditating on what to do next,he noticed three empty cans at the station's counter.He thought:"If I fill the first can and then empty it to the second one,and then take the third one… Maybe,I'll be able to measure out the needed amount of gasoline?"
As usual,he began to think about a general formulation of the problem,forgetting the partial case:"How many different capacities can I measure out using these cans?"
Of course,it is forbidden to spill gasoline because of ecology reasons.Also,the station's owner requires that gasoline only be transferred from the storage tank to a can or between cans.The car's tank may be filled from one or several of the cans only after all of the transfers.
Input
Each of the three input lines contains an integer from 0 to 255,which is the capacity of a gasoline can in liters.
Output
The result is an integer that is the number of different answers to the question how many liters the programmer can measure out using the gasoline cans with the specified capacities.
Sample
input
0
3
4
output
6
Hint
There is no sense to measure out 0 liters,so this value must not be counted.
请手动翻译。
是个计算问题,我简单帮您翻译了一下,仅供参考.
Once a gasoline meter broke at a filling station.Fortunately,there was an overflow clipper (a device that makes it possible not to overfill a tank).
一个汽油加油站的汽油计量表坏了,幸运的是这个油站装配了一个溢流截至阀.(一种安装在储罐中的防止溢流的装置).
An ACM-programmer came to this station and saw an announcement saying that the station didn't work properly.As he was meditating on what to do next,he noticed three empty cans at the station's counter.He thought:"If I fill the first can and then empty it to the second one,and then take the third one… Maybe,I'll be able to measure out the needed amount of gasoline?"
刚好一个ACM(可能是美国计算机协会的简写)的程序员刚好来到这个加油站并且看到了这个加油站不能正常工作的告示.他正在考虑该怎么办的时候他注意到在这个加油站的柜台上放着三个空铁罐.他想:“如果我把第一个铁罐加满然后再倒入第二个铁罐里,然后用第三个.也许我就能计算出我需要添加的汽油量了吧?
As usual,he began to think about a general formulation of the problem,forgetting the partial case:"How many different capacities can I measure out using these cans?"
跟平时一样,他开始思考解决问题的公式:“究竟我可以用这些铁罐估算出多少不同的添加量呢?”(意思就是说他想用这些铁罐的组合得到不同容积的汽油添加量)
Of course,it is forbidden to spill gasoline because of ecology reasons.Also,the station's owner requires that gasoline only be transferred from the storage tank to a can or between cans.The car's tank may be filled from one or several of the cans only after all of the transfers.
当然,因为环保的原因,汽油是不能随意倾倒的.同时加油站的老板要求汽油只能在储罐和铁罐或者铁罐之间操作.在这样的操作过后,只能用一个铁罐或者几个铁罐为汽车加油.
Input
输入
Each of the three input lines contains an integer from 0 to 255,which is the capacity of a gasoline can in liters.
每个输入管道可以输出包含从0-255升每个整数倍的汽油,每个铁罐的最大容积也是255升.
Output
输出
The result is an integer that is the number of different answers to the question how many liters the programmer can measure out using the gasoline cans with the specified capacities.
计算结果则为这个程序员通过对铁罐的操作所能获得的不同的添加量.
Sample
举例
input
输入
0
3
4
output
输出
6
Hint
提示
There is no sense to measure out 0 liters,so this value must not be counted.
因为无法计量0升,所以这个情况不考虑在内.