Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics;
- namespace demo
- {
- class Program
- {
- static void Main(string[] args)
- {
- //плажна хавлия = вход
- //чадър = хавлия * 2 / 3 - ok
- //плажна чанта = 1 / 3 * (джапанки + хавлията)
- //джапанки = 75% * чадър
- //сума = хавлия + чадър + чанта + джапанки
- //отстъпка -> 12% -> число ->
- //проверим дали и стига бюджетът
- int budget = int.Parse(Console.ReadLine());
- double towelPrice = double.Parse(Console.ReadLine());
- int discountPercent = int.Parse(Console.ReadLine());
- double umbrellaPrice = towelPrice * 2 / 3;
- double flipflopsPrice = 0.75 * umbrellaPrice;
- double bagPrice = (flipflopsPrice + towelPrice) / 3;
- double totalSum = towelPrice + umbrellaPrice + bagPrice + flipflopsPrice;
- totalSum = totalSum - (discountPercent / 100.0) * totalSum;
- if(budget >= totalSum)
- {
- double leftMoney = budget - totalSum;
- Console.WriteLine($"Annie's sum is {totalSum:F2} lv. She has {leftMoney:F2} lv. left.");
- }
- else
- {
- double needMoney = totalSum - budget;
- Console.WriteLine($"Annie's sum is {totalSum:F2} lv. She needs {needMoney:F2} lv. more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement