Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace EasterGuests
- {
- class Program
- {
- static void Main(string[] args)
- {
- double guest = int.Parse(Console.ReadLine());
- double budget = double.Parse(Console.ReadLine());
- double sum = Math.Ceiling(guest / 3) * 4 + guest * 2 * 0.45;
- if (budget >= sum)
- {
- Console.WriteLine($"Lyubo bought {Math.Ceiling(guest / 3)} Easter bread and {guest * 2} eggs.");
- Console.WriteLine($"He has {budget - sum:F2} lv. left.");
- }
- else
- {
- Console.WriteLine("Lyubo doesn't have enough money.");
- Console.WriteLine($"He needs {sum - budget:F2} lv. more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement