Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Sweet_Dessert
- {
- class Program
- {
- static void Main(string[] args)
- {
- var cash = decimal.Parse(Console.ReadLine());
- var guests = decimal.Parse(Console.ReadLine());
- var bannanaPrice = decimal.Parse(Console.ReadLine());
- var eggsPrice = decimal.Parse(Console.ReadLine());
- var berrriesPrice = decimal.Parse(Console.ReadLine());
- var portions = Math.Ceiling(guests / 6);
- var result = portions * (bannanaPrice * 2) + portions * (eggsPrice * 4) + portions * (berrriesPrice * 0.2m);
- if (cash > result)
- {
- Console.WriteLine("Ivancho has enough money - it would cost {0:F2}lv.", result);
- }
- else
- {
- Console.WriteLine("Ivancho will have to withdraw money - he will need {0:F2}lv more.", result - cash);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement