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 trip = double.Parse(Console.ReadLine());
- int puzzels = 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());
- int toysCount = dolls + puzzels + bears + minions + trucks;
- double toysSum = (puzzels * 2.6) + (dolls * 3) + (bears * 4.1) + (minions * 8.2) + (trucks * 2);
- if (toysCount >= 50)
- {
- double totalPrice = toysSum * 0.75;
- double totalSum = totalPrice * 0.9;
- double moneyLeft = totalSum - trip;
- if (totalSum >= trip)
- {
- Console.WriteLine($"Yes! {moneyLeft:F2} lv left.");
- }
- else if (totalSum < trip)
- {
- double moneyLeft2 = trip - totalSum;
- Console.WriteLine($"Not enough money! {moneyLeft2:F2} lv needed. ");
- }
- }
- else
- {
- double totalSum2 = toysSum * 0.9;
- double moneyForH = totalSum2 - trip;
- if (totalSum2 >= trip)
- {
- Console.WriteLine($"Yes! {moneyForH:F2} lv left.");
- }
- else
- {
- double moneyNot = trip - totalSum2;
- Console.WriteLine($"Not enough money! {moneyNot:F2} lv needed. ");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement