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 _02.Toy_Shop
- {
- class Program
- {
- static void Main(string[] args)
- {
- double priceExcursion = double.Parse(Console.ReadLine());
- int puzzel = int.Parse(Console.ReadLine());
- int dols = int.Parse(Console.ReadLine());
- int bears = int.Parse(Console.ReadLine());
- int minions = int.Parse(Console.ReadLine());
- int trucks = int.Parse(Console.ReadLine());
- double pricePuzzel = 2.60;
- double priceDols = 3.0;
- double priceBear = 4.10;
- double priceMinios = 8.20;
- double priceTruck = 2.0;
- double discount25PerCent = 0.75;
- double rent10PerCent = 0.10;
- double sum = puzzel * pricePuzzel + dols * priceDols + bears * priceBear + minions * priceMinios + trucks * priceTruck;
- double countOfToys = puzzel + dols + bears + minions + trucks;
- double diff = sum - (sum * rent10PerCent) ;
- if (countOfToys >= 50)
- {
- double priceWithDiscount = sum * discount25PerCent;
- double totalEarnPrice = priceWithDiscount - (priceWithDiscount * rent10PerCent);
- if (totalEarnPrice >= priceExcursion)
- {
- Console.WriteLine($"Yes! {totalEarnPrice - priceExcursion :f2} lv left.");
- }
- }
- else
- {
- Console.WriteLine($"Not enough money! {Math.Abs(diff - priceExcursion):f2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement