задача 9. Хотелска стая
Програмата ми работи перфектно, но ми дава 90%????
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hotel_Room
{
class Program
{
static void Main(string[] args)
{
string month = Console.ReadLine();
int nights = int.Parse(Console.ReadLine());
double priceSt = 0.0;
double priceAp = 0.0;
switch (month)
{
case "May":
priceSt = nights * 50;
priceAp = nights * 65;
if (nights >7&& nights<=14)
priceSt = priceSt - priceSt * 0.05;
else if (nights > 14)
{
priceSt = priceSt - priceSt * 0.30;
priceAp = priceAp - priceAp * 0.10;
}
break;
case "June":
priceSt = nights * 75.20;
priceAp = nights * 68.70;
if (nights > 14)
{
priceSt = priceSt - priceSt * 0.20;
priceAp = priceAp - priceAp * 0.10;
}
break;
case "July":
priceSt = nights * 76;
priceAp = nights * 77;
if (nights > 14)
priceAp = priceAp - priceAp * 0.10;
break;
case "August":
priceSt = nights * 76;
priceAp = nights * 77;
if (nights > 14)
priceAp = priceAp - priceAp * 0.10;
break;
case "September":
priceSt = nights * 76;
priceAp = nights * 77;
if (nights > 14)
{
priceSt = priceSt - priceSt * 0.20;
priceAp = priceAp - priceAp * 0.10;
}
break;
case "October":
priceSt = nights * 50;
priceAp = nights * 65;
if (nights > 7&&nights<=14)
priceSt = priceSt - priceSt * 0.05;
else if (nights > 14)
{
priceSt = priceSt - priceSt * 0.30;
priceAp = priceAp - priceAp * 0.10;
}
break;
}
Console.WriteLine("Apartment: {0:f2} lv.", priceAp);
Console.WriteLine("Studio: {0:f2} lv.", priceSt);
}
}
}
ти си изключил Нула Нощувки поне една ......мисля че това е.....