09. Padawan Equipment малко помощ
Малко помощ за 09. Padawan Equipment задача, judge ми дава 40 / 100 , а не мога да си открия грешката......
double SumIvancho = double.Parse(Console.ReadLine());
double studentsCount = int.Parse(Console.ReadLine());
double sabresPriceOne = double.Parse(Console.ReadLine());
double robesPriceOne = double.Parse(Console.ReadLine());
double beltsPriceOne = double.Parse(Console.ReadLine());
double sabresMore = Math.Ceiling(studentsCount * 10/100);
double priceSabres = sabresPriceOne * (studentsCount + sabresMore); ///
double priceBelts = 0;
double robesPrice = robesPriceOne * studentsCount;
if (studentsCount >= 6)
{
double priceOtstapkaForBelts = Math.Ceiling(studentsCount / 6); ////
studentsCount -= priceOtstapkaForBelts;
priceBelts = beltsPriceOne * studentsCount;
}
else
{
priceBelts = beltsPriceOne * studentsCount;
}
double total = priceSabres + priceBelts + robesPrice;
double result = Math.Abs(total - SumIvancho);
if (SumIvancho >= result)
{
Console.WriteLine($"The money is enough - it would cost {total:f2}lv.");
}
else
{
Console.WriteLine($"Ivan Cho will need {result:f2}lv more.");
}
Благодаря!!!