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 ekskyrziq = double.Parse(Console.ReadLine());
- int puzelCount = int.Parse(Console.ReadLine());
- int kykliCount = int.Parse(Console.ReadLine());
- int mechetaCount = int.Parse(Console.ReadLine());
- int minioniCount = int.Parse(Console.ReadLine());
- int kamionchetaCount = int.Parse(Console.ReadLine());
- double d_totalPricePuzel = puzelCount * 2.6;
- double d_totalPriceKykli = kykliCount * 3.0;
- double d_totalPriceMecheta = mechetaCount * 4.1;
- double d_totalPriceMinioni = minioniCount * 8.2;
- double d_totalPriceKamioncheta = kamionchetaCount * 2.0;
- int i_toysCount = puzelCount+ kykliCount+ mechetaCount+ minioniCount+ kamionchetaCount;
- double d_totalPrice = d_totalPricePuzel + d_totalPriceKykli + d_totalPriceMecheta + d_totalPriceMinioni + d_totalPriceKamioncheta;
- if (i_toysCount >= 50)
- {
- double totalPriceWithOtstupka = d_totalPrice - (d_totalPrice * 0.25);
- d_totalPrice = totalPriceWithOtstupka;
- }
- double d_naemMagazin = d_totalPrice - (d_totalPrice * 0.1);
- d_totalPrice = d_naemMagazin;
- if (d_totalPrice >= ekskyrziq)
- {
- double ostavashtiPari = d_totalPrice - ekskyrziq;
- Console.WriteLine($"Yes! {ostavashtiPari:F2} lv left.");
- }
- else
- {
- double nedostigashtiPari = ekskyrziq - d_totalPrice;
- Console.WriteLine($"Not enough money! {nedostigashtiPari:F2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement