08. On Time for the Exam - Conditional Statements Advanced - Exercise
Здравейте, някой може ли да каже къде греша? Всички тестове минават, но в judge ми дава 62/100
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
int examHours = int.Parse(Console.ReadLine());
int examMinutes = int.Parse(Console.ReadLine());
int arrivalHours = int.Parse(Console.ReadLine());
int arrivalMinutes = int.Parse(Console.ReadLine());
if ((examHours - 1) == arrivalHours && 30 <= examMinutes && arrivalMinutes > 30)
{
Console.WriteLine("Early");
Console.WriteLine($"{examMinutes + (60 - arrivalMinutes)} minutes before the start");
}
else if (examHours > arrivalHours && arrivalMinutes < 30)
{
Console.WriteLine("Early");
Console.WriteLine($"{examHours - arrivalHours}:{(examMinutes - arrivalMinutes):d2} hours before the start");
}
else if (examHours == arrivalHours && examMinutes == arrivalMinutes)
{
Console.WriteLine("On time");
}
else if ((examHours - 1) == arrivalHours && 30 >= examMinutes && arrivalMinutes > 30)
{
Console.WriteLine("On time");
Console.WriteLine($"{examMinutes + (60 - arrivalMinutes)} minutes before the start");
}
else if ((examHours - 1) == arrivalHours && 30 <= arrivalMinutes)
{
Console.WriteLine("On time");
Console.WriteLine($"{arrivalMinutes - examMinutes} minutes before the start");
}
else if ((examHours + 1) == arrivalHours && examMinutes > arrivalMinutes)
{
Console.WriteLine("Late");
Console.WriteLine($"{arrivalMinutes + examMinutes} minutes after the start");
}
else if (examHours == arrivalHours && examMinutes < arrivalMinutes)
{
Console.WriteLine("Late");
Console.WriteLine($"{arrivalMinutes - examMinutes} minutes after the start");
}
else if (examHours < arrivalHours)
{
Console.WriteLine("Late");
Console.WriteLine($"{arrivalHours - examHours}:{(arrivalMinutes - examMinutes):d2} hours after the start");
}
}
}
}