Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Toy_Shop
- {
- class Program
- {
- static void Main(string[] args)
- {
- double vacationPrice = double.Parse(Console.ReadLine());
- int puzzlesAmount = int.Parse(Console.ReadLine());
- int dollsAmount = int.Parse(Console.ReadLine());
- int teddyBearsAmount = int.Parse(Console.ReadLine());
- int minionsAmount = int.Parse(Console.ReadLine());
- int trucksAmount = int.Parse(Console.ReadLine());
- double sum = (puzzlesAmount * 2.60) + (dollsAmount * 3)
- + (teddyBearsAmount * 4.10) + (minionsAmount * 8.20)
- + (trucksAmount * 2);
- int toysAmount = puzzlesAmount + dollsAmount
- + teddyBearsAmount + minionsAmount + trucksAmount;
- bool discount = toysAmount >= 50; // Ако играчките са 50 ИЛИ ПОВЕЧЕ
- double discountSum = 0;
- if (discount == true)
- {
- discountSum = sum / 4;
- }
- else
- {
- discountSum = 0;
- }
- double lastSum = sum - discountSum;
- double rent = lastSum / 10;
- double wonMoney = lastSum - rent;
- if (wonMoney >= vacationPrice) // Ако печалбата е по-голяма или РАВНА на цената на екскурзията
- {
- Console.WriteLine($"Yes! {wonMoney - vacationPrice:F2} lv left.");
- }
- else if (wonMoney < vacationPrice)
- {
- Console.WriteLine($"Not enough money! {vacationPrice - wonMoney:F2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement