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 vacation = double.Parse(Console.ReadLine());
- int puzzles = int.Parse(Console.ReadLine());
- int dolls = int.Parse(Console.ReadLine());
- int bears = int.Parse(Console.ReadLine());
- int minions = int.Parse(Console.ReadLine());
- int trucks = int.Parse(Console.ReadLine());
- double sum = puzzles * 2.60 + dolls * 3 + bears * 4.10 + minions * 8.20 + trucks * 2;
- int toyNumber = puzzles + dolls + bears + minions + trucks;
- double discount = 0.0;
- if (toyNumber >= 50)
- {
- discount = sum * 0.25;
- }
- double endPrice = sum - discount;
- endPrice = endPrice - (endPrice * 0.10);
- if ( endPrice >= vacation)
- {
- endPrice = endPrice - vacation;
- Console.WriteLine($"Yes! {endPrice:F2} lv left.");
- }
- else
- {
- endPrice = vacation - endPrice;
- Console.WriteLine($"Not enough money! {endPrice:F2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement