-->
当前位置:首页 > 题库

PROGRAMMING:The Calculation of residential water charges

Luz5年前 (2021-05-10)题库549
In order to encourage the residents to save water, the water company adopts the step pricing method to calculate the water charges. The water charges that the residents should pay is related to the monthly water consumption x (ton): when X does not exceed 15 tons, y = 4x / 3; after exceeding, y = 2.5x − 17.5. Please write a program to realize the calculation of water charges.
### Input format:
Give a nonnegative real number x in one line.
### Output format:
Output the water charge to be paid in another line, accurate to 2 decimal places.
### sample input:
```in
sixteen
```
### sample output:
```out
twenty-two point five zero
```







answer:If there is no answer, please comment