Грешка при задача 08. Hotel Room
Привет ,
моля за помощ .
Мисля ,че работи коректно но Judge ми дава 40/100.
Ето и моя код в линка:
Благодаря за съдействието предварително:).
Привет ,
моля за помощ .
Мисля ,че работи коректно но Judge ми дава 40/100.
Ето и моя код в линка:
Благодаря за съдействието предварително:).
using System;
namespace Hotel_Room
{
    class Program
    {
        static void Main()
        {
            //Inputs
            string month = Console.ReadLine();                                             //Month of stay.
            byte nights = Convert.ToByte(Console.ReadLine());                    //Number of nights.
            decimal priceApartment =0m;
            decimal priceStudio = 0m;
            decimal discountApartment = 0m;
            decimal discountStudio = 0m;
            //Logic
            if (month == "May" || month == "October")                                    //Checks the month is it May or October.
            {
                priceApartment = nights * 65m;                                                 //Calculate the price for an apartment.
                priceStudio = nights * 50m;                                                       //Calculate the price for a studio.
                if (nights > 7)                                                                             //Check for discount for a studio.
                {
                    if (nights <= 14)
                    {
                        discountStudio = (priceStudio / 100) * 5;                          //Calculates the discount 5% for a stdio.
                    }
                    else
                    {
                        discountStudio = (priceStudio / 100) * 30;                        //Calculates the discount 30% for a stdio.
                    }
                }
            }
            if (month == "June" || month == "September")                              //Checks the month is it June or September.
            {
                priceApartment = nights * 68.7m;                                             //Calculate the price for an apartment.
                priceStudio = nights * 75.2m;                                                   //Calculate the price for a studio.
                if (nights > 14)                                                                          //Check for discount for a studio.
                {
                    discountStudio = (priceStudio / 100) * 20;                           //Calculates the discount 20% for a stdio.
                }
            }
            if (month == "July" || month == "August")                                    //Checks the month is it July or August.
            {
                priceApartment = nights * 77m;                                               //Calculate the price for an apartment.
                priceStudio = nights * 76m;                                                     //Calculate the price for a studio.
            }
            if (nights > 14)                                                                             //Check for discount for an apartment.
            {
                discountApartment = (priceApartment / 100) * 10;                  //Calculates the discount 10 % for an apartment.
            }
            priceApartment = priceApartment - discountApartment;             //Calculate the final price for an apartment.
            priceStudio = priceStudio - discountStudio;                                //Calculate the final price for a studio.
            //Outputs
            Console.WriteLine("Apartment: {0:F2} lv.", priceApartment);
            Console.WriteLine("Studio: {0:F2} lv.", priceStudio);
        }
    }
}
======================================
Поздрави,
Боби