Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ToyShop
- {
- class Program
- {
- static void Main()
- {
- double amount = 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 puzzlePrice = puzzles * 2.6;
- double dollsPrice = dolls * 3;
- double bearsPrice = bears * 4.1;
- double minionsPrice = minions * 8.2;
- double trucksPrice = trucks * 2;
- int toys = puzzles + dolls + bears + minions + trucks;
- double price = puzzlePrice + dollsPrice + bearsPrice + minionsPrice + trucksPrice;
- if (toys >= 50)
- {
- price *= 0.75;
- }
- price *= 0.9;
- if (price >= amount)
- {
- Console.WriteLine($"Yes! {price - amount:f2} lv left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! {amount - price:f2} lv needed.");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment