Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- double moneyTheyHave = double.Parse(Console.ReadLine());
- int studentsCount = int.Parse(Console.ReadLine());
- double priceOflightsabers = double.Parse(Console.ReadLine());
- double priceOfrobes = double.Parse(Console.ReadLine());
- double priceOfbelts = double.Parse(Console.ReadLine());
- double totalPrice = 0;
- int freeBeltsCount = studentsCount/6;
- totalPrice = Math.Ceiling(studentsCount * 1.1)* priceOflightsabers + studentsCount * priceOfrobes + (studentsCount - freeBeltsCount) * priceOfbelts;
- if (moneyTheyHave >= totalPrice)
- {
- Console.WriteLine($"The money is enough - it would cost {totalPrice:F2}lv.");
- }
- else
- {
- Console.WriteLine($"Ivan Cho will need {totalPrice - moneyTheyHave:F2}lv more.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement