09. Orders
Здравейте трябва ми малко помощ ,че тотално зациклих на тази задача>
1.Orders
We are placing N orders at a time. You need to calculate the price on the following formula:
((daysInMonth * capsulesCount) * pricePerCapsule)
Input / Constraints
- On the first line, you will receive integer N – the count of orders the shop will receive.
- For each order, you will receive the following information:
- Price per capsule - floating-point number in the range [0.00…5000.00].
- Days – integer in the range [1…31].
- Capsules count - integer in the range [0…7000000].
The input will be in the described format, there is no need to check it explicitly.
Output
The output should consist of N + 1 line. For each order, you must print a single line in the following format:
- "The price for the coffee is: ${price}"
On the last line, you need to print the total price in the following format:
- "Total: ${totalPrice}"
The price must be formatted to 2 decimal places.
Благодаря за вашето решение с for цикъл. Приложих го на rooftop snipers и подейства.