Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Magazin_za_igrachki
- {
- class Program
- {
- static void Main(string[] args)
- {
- double holidayPrice = double.Parse(Console.ReadLine());
- int puzzles = int.Parse(Console.ReadLine());
- int dalls = int.Parse(Console.ReadLine());
- int fluffBears = int.Parse(Console.ReadLine());
- int minions = int.Parse(Console.ReadLine());
- int trucks = int.Parse(Console.ReadLine());
- double puzzlesPrice = 2.60;
- int dallPrice = 3;
- double fluffBearPrice = 4.10;
- double minionPrice = 8.20;
- int trucksPrice = 2;
- double finalToyPrice = (puzzles * puzzlesPrice + dalls * dallPrice + fluffBears * fluffBearPrice + minions * minionPrice + trucks * trucksPrice);
- double numOfToys = (puzzles + dalls + fluffBears + minions + trucks);
- double discount = 0;
- if (numOfToys >= 50)
- {
- discount = finalToyPrice - (finalToyPrice * 0.75);
- }
- double totalEarnings = finalToyPrice - discount;
- double storeRent = totalEarnings - (totalEarnings * 0.90);
- double finalPrice = totalEarnings - storeRent;
- if (finalPrice >= holidayPrice)
- {
- Console.WriteLine($"Yes! {finalPrice - holidayPrice:f2} lv left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! {holidayPrice - finalPrice:f2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement