4. Лодка за риболов
Здравейте, имам два фейла на проверки в judge, които са без Input за дадената задача, които не засичам.
Може ли съвет?
using System;
namespace FishingBoat
{
internal class Program
{
static void Main(string[] args)
{
int budget = int.Parse(Console.ReadLine());
string season = Console.ReadLine();
int qtyFishermen = int.Parse(Console.ReadLine());
double rent = 0;
double discount = 0;
if (season=="Spring")
{
rent = 3000;
}
else if (season=="Summer" || season=="Autumn")
{
rent = 4200;
}
else if (season == "Winter")
{
rent = 2600;
}
if (qtyFishermen <= 6)
{
discount = rent * 0.1;
}
else if (qtyFishermen >= 7 && qtyFishermen<=11 )
{
discount = rent * 0.15;
}
else if (qtyFishermen >= 12 && qtyFishermen<=18)
{
discount = rent * 0.25;
}
if (qtyFishermen%2 == 0 && season!="Autumn")
{
discount = (rent - discount) * 0.05 + discount;
}
rent = rent - discount;
if (rent >= budget)
{
Console.WriteLine($"Not enough money! You need {rent - budget:F2} leva.");
}
else
{
Console.WriteLine($"Yes! You have {budget - rent:F2} leva left.");
}
}
}
}
Много благодаря!!!