Задача 10.Hotel Room
Здравейте,може ли малко помощ.
Judge-a дава 90 на кода, а всички проверки излизат:
using System;
namespace _07._Hotel_Room
{
class Program
{
static void Main()
{
string month = Console.ReadLine();
double nightsNum = double.Parse(Console.ReadLine());
double apartmentPrice = 0;
double studioPrice = 0;
if (month == "May" || month == "October")
{
if(nightsNum >= 7 && nightsNum <=14)
{
apartmentPrice = 65 * nightsNum;
studioPrice = (50 - (50 * 0.05)) * nightsNum;
}
else //if(nightsNum > 14)
{
apartmentPrice = (65 - (65 * 0.10)) * nightsNum;
studioPrice = (50 - (50 * 0.30)) * nightsNum;
}
}
else if(month == "June" || month == "September")
{
if(nightsNum > 14)
{
apartmentPrice = (68.70 - (68.70 * 0.10)) * nightsNum;
studioPrice = (75.20 - (75.20 * 0.20)) * nightsNum;
}
else
{
apartmentPrice = 68.70 * nightsNum;
studioPrice = 75.20 * nightsNum;
}
}
else if(month == "July" || month == "August")
{
if(nightsNum >14)
{
studioPrice = 76 * nightsNum;
apartmentPrice = (77 - (77 * 0.10)) * nightsNum;
}
else
{
studioPrice = 76 * nightsNum;
apartmentPrice = 77 * nightsNum;
}
}
Console.WriteLine($"Apartment: {apartmentPrice:f2} lv.");
Console.WriteLine($"Studio: {studioPrice:f2} lv.");
}
}
}
Благодаря
it seems about right