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;
- double moneyNot = trip - totalSum;
- if (totalSum >= trip)
- {
- Console.WriteLine($"Yes! {moneyLeft:F2} lv left.");
- }
- else
- {
- Console.WriteLine($"Not enought money! {moneyNot:F2} lv needed. ");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement