Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SkiEquitment
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- double skiPrice = double.Parse(Console.ReadLine());
- double shtekiPrice = double.Parse(Console.ReadLine());
- double skiBoots = skiPrice - skiPrice * 0.6;
- double skiEquitment = skiPrice + skiPrice * 0.4;
- double totalPrice = skiBoots + skiEquitment + skiPrice + shtekiPrice;
- double finalPrice = budget - totalPrice;
- double difference = totalPrice - budget;
- if (totalPrice > 800)
- {
- totalPrice = skiBoots + skiEquitment + skiPrice;
- finalPrice = budget - totalPrice;
- }
- else
- {
- totalPrice = skiPrice + shtekiPrice + skiPrice + skiBoots;
- finalPrice = budget - totalPrice;
- }
- if (totalPrice <= budget)
- {
- Console.WriteLine($"Angel's sum is {totalPrice:f2} lv. He has {finalPrice:f2} lv. left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! You need {difference:F2} leva more!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement