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

PROGRAMMING:Price 2

Luz5年前 (2021-05-10)题库434
Mother goes out to buy vegetables every day, but when she comes back, she doesn't bother to count the money in her pocket. How much money she spent is really a muddle headed debt. Now, as a good son (daughter), you can program it for her. Mom has to pay for every dish, and she uses the method of rounding to get rid of the split.
For example, if you buy only one kind of chicken leg, you can buy two chicken legs at 4.26 yuan each and pay 8.5 yuan. Buy a number of, as shown in the table below, each calculated amount rounded and then summarized. When mom came back, how much did she spend according to the variety and quantity of vegetables in the basket?
As follows:
number Unit Price amount of money total Rounding off
egg 3 2.55 7.65 7.7
Bitter herbs one six point two three six point two three six point two
Tomatoes three three point five ten point five ten point five
total twenty-four point four
###Input format:
The first line: enter n, which means you have bought N kinds of vegetables.
In the next N lines, enter the quantity (may be decimal) and unit price (may be decimal, unit: RMB) of a dish in each line. There are spaces between the quantity and unit price.
###Output format:
When paying the price of vegetables, the smallest unit of payment is Jiao, so when calculating the price of each kind of vegetables, we first use the rounding method to remove the sub head, and then summarize the total price of vegetables. Finally, the output of a precision angle of the total price.
###Input example:
Here is a set of inputs. For example:
```in
three
1 2
2 1.52
2 4.22
```
###Output example:
The corresponding output is given here. For example:
```out
thirteen point four
```
Tip: please deal with rounding correctly, and do not add up the allowance for each dish< br>





answer:If there is no answer, please comment