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

PROGRAMMING:Postage Calculations

Luz5年前 (2021-05-10)题库427
According to the weight of the mail and whether the user chooses to speed up the calculation of postage. Calculation rule: weight less than 1000g (including 1000g), basic cost 8 yuan. If the weight exceeds 1000 grams, 4 yuan will be charged for every 500 grams. If the weight is less than 500 grams, 500 grams will be charged; If the user chooses to rush, 5 yuan more will be charged.
###Input format:
Enter a line containing an integer and a character separated by a space to indicate the weight (in grams) and whether it is urgent or not. If the character is y, it means urgent is selected; If the character is n, it is not urgent.
###Output format:
Output a line containing an integer representing the postage.
###Input example:
```in
1200 y
```
###Output example:
```out
seventeen
```







answer:If there is no answer, please comment