Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Runtime.CompilerServices;
- using System.Xml;
- class Program
- {
- public static void Main(string[] args)
- {
- //⦁ Пъзел - 2.60 лв.
- //⦁ Говореща кукла - 3 лв.
- //⦁ Плюшено мече - 4.10 лв.
- //⦁ Миньон - 8.20 лв.
- //⦁ Камионче - 2 лв.
- double priceForExursion = double.Parse(Console.ReadLine());
- int countPuzzles = int.Parse(Console.ReadLine());
- int countDolls = int.Parse(Console.ReadLine());
- int bearToys = int.Parse(Console.ReadLine());
- int minionsToys = int.Parse(Console.ReadLine());
- int truckToys = int.Parse(Console.ReadLine());
- double countPuzzlesPrice = countPuzzles * 2.60;
- double countDollsPrice = countDolls * 3;
- double bearToysPrice = bearToys * 4.10;
- double minionsToysPrice =minionsToys * 8.20;
- double trucKToysPrice= truckToys * 2;
- double sum = countPuzzlesPrice + countDollsPrice + bearToysPrice + minionsToysPrice + trucKToysPrice;
- int sumOfToys = countPuzzles + countDolls + bearToys + minionsToys + truckToys;
- double disc = 0;
- double calcDisc = 0;
- if (sumOfToys>=50)
- {
- calcDisc = sum * 0.25;
- }
- disc = sum - calcDisc;
- double rent = disc * 0.1;
- double result = disc - rent;
- double leftMonet = result - priceForExursion;
- if (result >=priceForExursion)
- {
- Console.WriteLine($"Yes! {leftMonet:f2} lv left.");
- }
- double needMoney = priceForExursion - result;
- if (result<priceForExursion)
- {
- Console.WriteLine($"Not enough money! {needMoney:f2} lv needed.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement