Advertisement
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 = int.Parse(Console.ReadLine());
- double b = budget;
- double moviesCount = double.Parse(Console.ReadLine());
- string movieName = string.Empty;
- double moviePrice = 0;
- double thrones = 50;
- double lucifer = 40;
- double protector = 30;
- double totalDrama = 20;
- double area = 10;
- double sum = 0;
- for (int i = 0; i < moviesCount; i++)
- {
- movieName = Console.ReadLine();
- moviePrice = double.Parse(Console.ReadLine());
- switch (movieName)
- {
- case "Thrones":
- budget -= moviePrice - (moviePrice * 50) / 100;
- sum += moviePrice - (moviePrice * 50) / 100;
- break;
- case "Lucifer":
- budget -= moviePrice - (moviePrice * 40) / 100;
- sum += moviePrice - (moviePrice * 40) / 100;
- break;
- case "Protector":
- budget -= moviePrice - (moviePrice * 30) / 100;
- sum += moviePrice - (moviePrice * 30) / 100;
- break;
- case "TotalDrama":
- budget -= moviePrice - (moviePrice * 20) / 100;
- sum += moviePrice - (moviePrice * 20) / 100;
- break;
- case "Area":
- budget -= moviePrice - (moviePrice * 10) / 100;
- sum += moviePrice - (moviePrice * 10) / 100;
- break;
- default:
- budget -= moviePrice;
- sum += moviePrice;
- break;
- }
- }
- if (b >= sum)
- {
- Console.WriteLine($"You bought all the series and left with {budget:F2} lv.");
- }
- else
- {
- Console.WriteLine($"You need {sum - b:F2} lv. more to buy the series!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement