Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SummerShopping
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- double towel = double.Parse(Console.ReadLine());
- int discount = int.Parse(Console.ReadLine());
- double umbrella = towel / 3 * 2;
- double flipFlops = umbrella * 0.75;
- double beachBag = (towel + flipFlops) / 3;
- double sum = (towel + umbrella + flipFlops + beachBag) * (100 - discount) / 100;
- Console.Write($"Annie's sum is {sum:f2} lv. ");
- if (budget >= sum)
- {
- Console.WriteLine($"She has {budget - sum:f2} lv. left.");
- }
- else
- {
- Console.WriteLine($"She needs {sum - budget:f2} lv. more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement