Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _02.Toy_Shop
- {
- class Program
- {
- static void Main()
- {
- double priceForHoliday = double.Parse(Console.ReadLine());
- int numOFPuzels = int.Parse(Console.ReadLine());
- int talkativeDolls = int.Parse(Console.ReadLine());
- int Bears = int.Parse(Console.ReadLine());
- int minions = int.Parse(Console.ReadLine());
- int trucks = int.Parse(Console.ReadLine());
- var totalToys = numOFPuzels + talkativeDolls + Bears + minions + trucks;
- var sumOfToys = (numOFPuzels * 2.60) + (talkativeDolls * 3) + (Bears * 4.10) + (minions * 8.20) + (trucks * 2);
- if (totalToys>=50)
- {
- var totalPriceAfterDiscount = sumOfToys - (sumOfToys * 25) / 100;
- var totalForPetya = totalPriceAfterDiscount - (totalPriceAfterDiscount * 10) / 100;
- if (totalForPetya>=priceForHoliday)
- {
- var leftMoney = totalForPetya - priceForHoliday;
- Console.WriteLine($"Yes! {leftMoney:f2} lv left.");
- }
- else
- {
- var neededmoney = priceForHoliday - totalForPetya;
- Console.WriteLine($"Not enough money! {neededmoney:f2} lv needed.");
- }
- }
- else
- {
- var totalForPetya = sumOfToys - (sumOfToys*10)/100;
- if (totalForPetya >= priceForHoliday)
- {
- var leftMoney = totalForPetya - priceForHoliday;
- Console.WriteLine($"Yes! {leftMoney:f2} lv left.");
- }
- else
- {
- var neededmoney = priceForHoliday - totalForPetya;
- Console.WriteLine($"Not enough money! {neededmoney:f2} lv needed.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement