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 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 puzzlesPrice = puzzles * 2.60;
- double dollsPrice = dolls * 3;
- double bearsPrice = bears * 4.10;
- double minionsPrice = minions * 8.20;
- double trucksPrice = trucks * 2;
- double totalSum = puzzlesPrice + dollsPrice + bearsPrice + minionsPrice + trucksPrice;
- int totalToys = puzzles + dolls + bears + minions + trucks;
- if (totalToys >= 50)
- {
- double afterDiscount = totalSum - (totalSum * 0.25);
- double rent = afterDiscount * 0.10;
- double profit = afterDiscount - rent;
- if (profit >= tripPrice)
- {
- double moneyLeft = profit - tripPrice;
- Console.WriteLine($"Yes! {moneyLeft:F2} lv left.");
- }
- else
- {
- double moneyLeft = tripPrice - profit;
- Console.WriteLine($"Not enough money! {moneyLeft:F2} lv needed.");
- }
- }
- else
- {
- double rent = totalSum * 0.10;
- double profit = totalSum - rent;
- if (profit >= tripPrice)
- {
- double moneyLeft = profit - tripPrice;
- Console.WriteLine($"Yes! {moneyLeft:F2} lv left.");
- }
- else
- {
- double moneyLeft = tripPrice - profit;
- Console.WriteLine($"Not enough money! {moneyLeft:F2} lv needed.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement