Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Series
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- int volume = int.Parse(Console.ReadLine());
- for (int i = 0; i < volume; i++)
- {
- string name = Console.ReadLine();
- double cash = double.Parse(Console.ReadLine());
- switch (name)
- {
- case "Thrones":
- cash /= 2;
- break;
- case "Lucifer":
- cash *= 0.6;
- break;
- case "Protector":
- cash *= 0.7;
- break;
- case "TotalDrama":
- cash *= 0.8;
- break;
- case "Area":
- cash *= 0.9;
- break;
- }
- budget -= cash;
- }
- if (budget >= 0)
- {
- Console.WriteLine($"You bought all the series and left with {budget:F2} lv.");
- }
- else
- {
- Console.WriteLine($"You need {Math.Abs(budget):F2} lv. more to buy the series!");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment