Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SweetDessert
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- int guests = int.Parse(Console.ReadLine());
- double bananaPrice = double.Parse(Console.ReadLine());
- double eggPrice = double.Parse(Console.ReadLine());
- double berriesKiloPrice = double.Parse(Console.ReadLine());
- double neededMoney = Math.Ceiling((double)guests / 6) * (bananaPrice * 2 + eggPrice * 4 + berriesKiloPrice / 5);
- if(budget >= neededMoney)
- {
- Console.WriteLine($"Ivancho has enough money - it would cost {neededMoney:f2}lv.");
- }
- else
- {
- Console.WriteLine($"Ivancho will have to withdraw money - he will need {neededMoney - budget:f2}lv more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement