Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Toys_shop_2
- {
- class Program
- {
- static void Main(string[] args)
- {
- double priceTrip = double.Parse(Console.ReadLine());
- int countOfPuzzle = int.Parse(Console.ReadLine());
- int countOfDolls = int.Parse(Console.ReadLine());
- int countOfBears = int.Parse(Console.ReadLine());
- int countOfMinions = int.Parse(Console.ReadLine());
- int countOfTrucks = int.Parse(Console.ReadLine());
- double countOfToys = countOfPuzzle + countOfDolls + countOfBears + countOfMinions + countOfTrucks;
- double totalPrice = countOfPuzzle * 2.60 + countOfDolls * 3 + countOfBears * 4.10 + countOfMinions * 8.20 + countOfTrucks * 2;
- if (countOfToys >= 50)
- {
- totalPrice = totalPrice * 0.75;
- totalPrice = totalPrice * 0.90;
- }
- else if (countOfToys < 50)
- {
- totalPrice = totalPrice * 0.90;
- }
- if (totalPrice >= priceTrip)
- {
- Console.WriteLine($"Yes! {totalPrice - priceTrip:f2} lv left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! {priceTrip - totalPrice:f2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment