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 SweetDesert
- {
- class SweetDesert
- {
- static void Main()
- {
- decimal amountOFCash = decimal.Parse(Console.ReadLine());
- decimal numberOFGuest = decimal.Parse(Console.ReadLine());
- decimal bananaPrice = decimal.Parse(Console.ReadLine());
- decimal eggsPrice = decimal.Parse(Console.ReadLine());
- decimal berriesKilo = decimal.Parse(Console.ReadLine());
- decimal sets =Math.Ceiling(numberOFGuest / 6);
- decimal result = sets * (2 * bananaPrice) + sets * (4 * eggsPrice) + sets * (0.2M * berriesKilo);
- if(result <= amountOFCash)
- {
- Console.WriteLine("Ivancho has enough money - it would cost {0:F2}lv.",result);
- }
- else
- {
- decimal moremoney = result - amountOFCash;
- Console.WriteLine("Ivancho will have to withdraw money - he will need {0:F2}lv more.",moremoney);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement