Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ToysShop
- {
- class Program
- {
- static void Main(string[] args)
- {
- decimal priceTour = decimal.Parse(Console.ReadLine());
- int numberPuzzels = int.Parse(Console.ReadLine());
- int numberDolls = int.Parse(Console.ReadLine());
- int numberBears = int.Parse(Console.ReadLine());
- int numberMinions = int.Parse(Console.ReadLine());
- int numberTrucks = int.Parse(Console.ReadLine());
- int totalCount = numberPuzzels + numberDolls + numberBears + numberMinions + numberTrucks;
- decimal totalPrice = 0;
- totalPrice = numberPuzzels * (decimal)2.6
- + numberDolls * (decimal)3
- + numberBears * (decimal)4.1
- + numberMinions * (decimal)8.2
- + numberTrucks * (decimal)2;
- decimal remains;
- if (totalCount >= 50){
- totalPrice = totalPrice * 0.75m;
- }
- totalPrice = totalPrice * 0.9m;
- remains = Math.Abs(priceTour - totalPrice);
- if (priceTour <= totalPrice){
- //remains = totalPrice - priceTour;
- Console.WriteLine($"Yes! {remains:F2} lv left.");
- }
- else{
- Console.WriteLine($"Not enough money! {remains:F2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement