Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace exampreparation
- {
- class exam
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- int seriesCount = int.Parse(Console.ReadLine());
- for (int i = 0; i < seriesCount; i++)
- {
- string seriesTitle = Console.ReadLine();
- double seriesPrice = double.Parse(Console.ReadLine());
- if (seriesTitle == "Thrones")
- {
- seriesPrice *= 0.50;
- }
- else if (seriesTitle == "Lucifer")
- {
- seriesPrice *= 0.60;
- }
- else if (seriesTitle == "Protector")
- {
- seriesPrice *= 0.70;
- }
- else if (seriesTitle == "TotalDrama")
- {
- seriesPrice *= 0.80;
- }
- else if (seriesTitle == "Area")
- {
- seriesPrice *= 0.90;
- }
- budget -= seriesPrice;
- }
- 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!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment