Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Practice___Padawan_Equipment
- {
- class Program
- {
- static void Main(string[] args)
- {
- double amouthOfMoney = double.Parse(Console.ReadLine());
- int countOfStudents = int.Parse(Console.ReadLine());
- double priceOfLightsabers = double.Parse(Console.ReadLine());
- double priceOfRobes = double.Parse(Console.ReadLine());
- double priceOfBelts = double.Parse(Console.ReadLine());
- double additionalLightsabers = countOfStudents / 0.90;
- double ceiledPriceOfSabers = Math.Ceiling(additionalLightsabers);
- double freeBelts = countOfStudents / 6;
- double sabers = (priceOfLightsabers * ceiledPriceOfSabers);
- double robes = (priceOfRobes * countOfStudents);
- double belts = (priceOfBelts * (countOfStudents - freeBelts));
- double sum = sabers + robes + belts;
- if (sum > amouthOfMoney)
- {
- double moneyNeeded = sum - amouthOfMoney;
- Console.WriteLine($"Ivan Cho will need {moneyNeeded:F2}lv more.");
- }
- else
- {
- Console.WriteLine($"The money is enough - it would cost {sum:F2}lv.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement