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 Easter_Guests
- {
- class Program
- {
- static void Main(string[] args)
- {
- double numberOfGuests = double.Parse(Console.ReadLine());
- double budget = double.Parse(Console.ReadLine());
- double numberOfEasterBread = Math.Ceiling(numberOfGuests / 3);
- double numberOfEggs = numberOfGuests * 2;
- double priceOfEasterBread = numberOfEasterBread * 4;
- double priceOfEggs = numberOfEggs * 0.45;
- double totalPrice = priceOfEasterBread + priceOfEggs;
- double moneyLeft = budget - totalPrice;
- if(budget >= totalPrice)
- {
- Console.WriteLine($"Lyubo bought {numberOfEasterBread} Easter bread and {numberOfEggs} eggs.");
- Console.WriteLine($"He has {moneyLeft:F2} lv. left.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement