Можете ли да ми кажете къде греша ?
int hourExam = int.Parse(Console.ReadLine());
int minuteExam = int.Parse(Console.ReadLine());
int hourArrive = int.Parse(Console.ReadLine());
int minuteArrive = int.Parse(Console.ReadLine());
int examTime = hourExam * 60 + minuteExam;
int arriveTime = hourArrive * 60 + minuteArrive;
int finalHour = 0;
int finalMinutes = 0;
if (examTime >= arriveTime)
{
int finalTime = examTime - arriveTime;
finalHour = finalTime / 60;
finalMinutes = finalTime % 60;
if (finalTime == 0)
{
Console.WriteLine("On time");
}
else if (finalTime <= 30)
{
Console.WriteLine("On time");
Console.WriteLine($"{finalMinutes} minutes before the start");
}
else if (finalTime > 30)
{
Console.WriteLine("Early");
if (finalHour == 0)
{
Console.WriteLine($" {finalMinutes} minutes before the start");
}
else if (finalHour == 0 && finalMinutes >= 10)
{
Console.WriteLine($"{finalHour}:{finalMinutes} hours before the start ");
}
else if (finalHour == 0 && finalMinutes < 10)
{
Console.WriteLine($"{finalHour}:{finalMinutes} hours before the start ");
}
}
}
else if (examTime < arriveTime)
{
int finalTime = arriveTime - examTime;
finalHour = finalTime / 60;
finalMinutes = finalTime % 60;
Console.WriteLine("late");
if (finalHour == 0)
{
Console.WriteLine($"{finalTime} minutes after the start");
}
else if (finalHour == 0 && finalMinutes >= 0)
{
Console.WriteLine($"{finalHour}:{finalMinutes} hours after the start");
}
else if (finalHour == 0 && finalMinutes < 0)
{
Console.WriteLine($"{finalHour}:{finalMinutes} hours after the start");
}
}