Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Numerics;
- class SoftuniCoffeeOrders
- {
- static void Main()
- {
- int numberOfOrders = int.Parse(Console.ReadLine());
- decimal overallProfit = 0;
- for (int currentOrder = 0; currentOrder < numberOfOrders; currentOrder++)
- {
- BigInteger pricePerCaps = BigInteger.Parse(Console.ReadLine());
- DateTime daysInMon = DateTime.ParseExact(Console.ReadLine(),
- "d/M/yyyy", System.Globalization.CultureInfo.InvariantCulture);
- int days = DateTime.DaysInMonth(daysInMon.Year, daysInMon.Month);
- int capsulesCount = int.Parse(Console.ReadLine());
- decimal profit = ((days * (decimal)capsulesCount) * (decimal)(pricePerCaps));
- overallProfit += profit;
- if (profit > overallProfit)
- {
- profit++;
- }
- Console.WriteLine($"The price for the coffee is: ${profit:f2}");
- Console.WriteLine($"Total: ${overallProfit:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement