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 _9.Padawan_Equipment
- {
- class Program
- {
- static void Main(string[] args)
- {
- double GivenMoney = double.Parse(Console.ReadLine());
- double studentsCount = double.Parse(Console.ReadLine());
- double priceLightsabers = double.Parse(Console.ReadLine());
- double priceRobes = double.Parse(Console.ReadLine());
- double priceBelts = double.Parse(Console.ReadLine());
- double freeBelts = Math.Floor(studentsCount / 6);
- double ExtraLightsabers = Math.Ceiling(studentsCount + (studentsCount * 10 / 100));
- double priceLightsabersStudents = ExtraLightsabers * priceLightsabers;
- double priceRobesStudents = studentsCount * priceRobes;
- double priceBeltsStudents = (priceBelts * studentsCount) - (freeBelts * priceBelts);
- double priceForAllStudents = priceLightsabersStudents + priceRobesStudents + priceBeltsStudents;
- if (GivenMoney >= priceForAllStudents)
- {
- Console.WriteLine($"The money is enough - it would cost {priceForAllStudents:f2}lv.");
- }
- else
- {
- Console.WriteLine($"Ivan Cho will need {Math.Abs(GivenMoney - priceForAllStudents):f2}lv more.");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment