Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Padawan_Equipment
- {
- class Program
- {
- static void Main(string[] args)
- {
- float amounOfMoney = float.Parse(Console.ReadLine());
- int countOfStudents = int.Parse(Console.ReadLine());
- float priceOfLightsabers = float.Parse(Console.ReadLine());
- float priceOfRobes = float.Parse(Console.ReadLine());
- float priceOfLightBelts = float.Parse(Console.ReadLine());
- int freeBelts = 0;
- if (countOfStudents % 6 == 0)
- {
- freeBelts += 1;
- }
- double neededMoney = priceOfLightsabers * (Math.Ceiling(countOfStudents * 1.1)) + priceOfRobes * countOfStudents + priceOfLightBelts * (countOfStudents - freeBelts);
- if (neededMoney <= amounOfMoney)
- {
- Console.WriteLine($"The money is enough - it would cost {neededMoney:F2}lv.");
- }
- else if (neededMoney > amounOfMoney)
- {
- Console.WriteLine($"Ivan Cho will need {neededMoney - amounOfMoney:F2}lv more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement