Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace toyShop
- {
- class Program
- {
- static void Main(string[] args)
- {
- double tripPrice = double.Parse(Console.ReadLine());
- int puzzleCount = int.Parse(Console.ReadLine());
- int dollsCount = int.Parse(Console.ReadLine());
- int bearsCount = int.Parse(Console.ReadLine());
- int minionsCount = int.Parse(Console.ReadLine());
- int trucksCount = int.Parse(Console.ReadLine());
- double puzzlePrice = 2.60;
- int dollsPrice = 3;
- double bearsPrice = 4.10;
- double minionsPrice = 8.20;
- int trucksPrice = 2;
- double rent = 0.10;
- double sum = (puzzleCount * puzzlePrice) + (dollsCount * dollsPrice) + (bearsCount * bearsPrice) + (minionsCount * minionsPrice) + (trucksCount * trucksPrice);
- if (puzzleCount + dollsCount + bearsCount + minionsCount + trucksCount >= 50)
- {
- double discount = 0.25;
- double totalSum = sum - (sum * discount);
- double rentSum = totalSum - (totalSum * rent);
- Console.WriteLine($"Yes! {rentSum - tripPrice:F2} lv left.");
- }
- else
- {
- double totalSum = sum - (sum * rent);
- Console.WriteLine($"Not enough money! {tripPrice - totalSum:F2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement