Задача 5. Orders
Здравейте, имам проблем с тази задача, получавам 57/100 в Judge.
Ще съм много благодарен ако някой може да помогне с насока къде бъркам.
5. Orders
You work at a coffee shop, and your job is to place orders to the distributors. Thus, you want to know the price of each order. On the first line, you will receive integer N - the number of orders the shop will receive. For each order, you will receive the following information:
- Price per capsule - a floating-point number [0.01…100.00]
- Days - integer in the range [1…31]
- Capsules, needed per day - integer [1…2000]
For each order, you should print a single line in the following format:
- "The price for the coffee is: ${price}"
If you do not receive a correct order (one or more of the values are not in the given range), you should ignore it and move to the next one.
After you go through all orders, you need to print the total price in the following format:
- "Total: ${total_price}"
Both the price of a coffee and the total price must be formatted to the second decimal place.
Examples
Input |
Output |
1 1.53 30 8 |
The price for the coffee is: $367.20 Total: $367.20 |
2 4.99 31 3 0.35 31 5 |
The price for the coffee is: $464.07 The price for the coffee is: $54.25 Total: $518.32
|
2 9.223 31 0 0.05 10 30 |
The price for the coffee is: $15.00 Total: $15.00
|
Кодът ми: https://pastebin.com/MnPcz62A
Thanks for the info. Why don't you try the hard game worldwide called geometry dash lite. Have a nice day!