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 ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Пъзел - 2.60 лв.
- // Говореща кукла -3 лв.
- // Плюшено мече -4.10 лв.
- // Миньон - 8.20 лв.
- // Камионче - 2 лв.
- // > 50 - 25% disc
- // 10 % = Loan
- double tourPrice = double.Parse(Console.ReadLine());
- int puzz = int.Parse(Console.ReadLine());
- int dolls = int.Parse(Console.ReadLine());
- int bears = int.Parse(Console.ReadLine());
- int min = int.Parse(Console.ReadLine());
- int trucks = int.Parse(Console.ReadLine());
- int toysCnt = puzz + dolls + bears + min + trucks;
- double toysPrice = (puzz * 2.60) + (dolls * 3) + (bears * 4.10) + (min * 8.2) + (trucks * 2);
- double afterDisc = toysPrice;
- if (toysCnt >= 50)
- {
- afterDisc = toysPrice - (toysPrice * 0.25);
- }
- double finalPrice = afterDisc - (afterDisc * 0.10);
- if (finalPrice >= tourPrice)
- {
- Console.WriteLine($"Yes! {finalPrice - tourPrice:F2} lv left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! {tourPrice - finalPrice:F2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement