07. Working Hours (C#) - Help Needed!
Здравейте,
В Judge ми дава 85/100 точки като не мога да разбера каква е грешката.
Дали някой може да помогне?
using System;
using System.Data;
namespace WorkingHours
{
class Program
{
static void Main(string[] args)
{
int hours = int.Parse(Console.ReadLine());
string day = Console.ReadLine();
if (10 <= hours && hours <= 18)
{
switch (day)
{
case "Monday":
case "Tuesday":
case "Wednesday":
case "Thurdsay":
case "Friday":
case "Saturday":
Console.WriteLine("open");
break;
case "Sunday":
default:
Console.WriteLine("closed");
break;
}
}
else
{
Console.WriteLine("closed");
}
}
}
}
Пробвах, но пак ми дава 85 точки.
Try the following, as the old code prints out 'closed' when entering 12 Pesho.
Best,
using System;
using System.Data;
namespace WorkingHours
{
class Program
{
static void Main(string[] args)
{
int hours = int.Parse(Console.ReadLine());
string day = Console.ReadLine();
if (hours >= 10 && hours <= 18)
{
switch (day)
{
case "Monday":
case "Tuesday":
case "Wednesday":
case "Thurdsay":
case "Friday":
case "Saturday":
Console.WriteLine("open");
break;
case "Sunday":
Console.WriteLine("closed");
break;
default:
//Console.WriteLine("closed");
break;
}
}
//else
//{
// Console.WriteLine("closed");
//}
}
}
}
Благодаря, грешката беше открита.