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 ToyShop
- {
- class Program
- {
- static void Main(string[] args)
- {
- double priceEscursion = double.Parse(Console.ReadLine());
- int puzzles = int.Parse(Console.ReadLine());
- int talkingDolls = int.Parse(Console.ReadLine());
- int teddyBears = int.Parse(Console.ReadLine());
- int minions = int.Parse(Console.ReadLine());
- int trucks = int.Parse(Console.ReadLine());
- double totalAmount = puzzles * 2.6 + talkingDolls * 3 + teddyBears * 4.1 + minions * 8.2 + trucks * 2;
- if ((puzzles + talkingDolls + teddyBears + minions + trucks) > 50)
- {
- totalAmount = totalAmount - totalAmount * 25 / 100;
- }
- totalAmount = totalAmount - totalAmount * 10 / 100;
- if (totalAmount < priceEscursion)
- {
- Console.WriteLine($"Not enough money! {(priceEscursion - totalAmount):F2} lv needed.");
- }
- else
- {
- Console.WriteLine($"Yes! {(totalAmount - priceEscursion):F2} lv left.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement