Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Club
- {
- class Program
- {
- static void Main(string[] args)
- {
- double neededSum = double.Parse(Console.ReadLine());
- string drink = Console.ReadLine();
- double profit = 0;
- while (drink != "Party!" && profit < neededSum)
- {
- int volume = int.Parse(Console.ReadLine());
- double sum = drink.Length * volume;
- if (sum % 2 == 1)
- {
- sum *= 0.75;
- }
- profit += sum;
- drink = Console.ReadLine();
- }
- if (neededSum > profit)
- {
- Console.WriteLine($"We need {neededSum - profit:F2} leva more.");
- }
- else
- {
- Console.WriteLine("Target acquired.");
- }
- Console.WriteLine($"Club income - {profit:F2} leva.");
- }
- }
- }
Add Comment
Please, Sign In to add comment