On Time for the Exam - мако помощ 56/100
56/100 помощ малко
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace On_Time_for_the_Exam
{
class Program
{
static void Main(string[] args)
{
int hourОfЕxamination = int.Parse(Console.ReadLine());
int minuteExam = int.Parse(Console.ReadLine());
int hourOfArrival = int.Parse(Console.ReadLine());
int minuteOfArrival = int.Parse(Console.ReadLine());
int Student = 0;
double sumExamination = (hourОfЕxamination * 60) + minuteExam;
double sumArrival = (hourOfArrival * 60) + minuteOfArrival;
double totalMinutes = sumExamination - sumArrival;
TimeSpan result = TimeSpan.FromMinutes(totalMinutes);
if (totalMinutes > 0 && totalMinutes <= 30)
{
Console.WriteLine($"On time {result.ToString("mm")} minutes before the start");
}
else if (totalMinutes > 30)
{
Console.WriteLine($"Early {result.ToString("h\\:mm")} hours before the start");
}
else if (totalMinutes < 0 && totalMinutes > 59)
{
Console.WriteLine($"Late {result.ToString("mm")} minutes after the start");
}
else if (totalMinutes == 0)
{
Console.WriteLine("On time");
}
else if (totalMinutes < 60 )
{
Console.WriteLine($"Late {result.ToString("h\\:mm")} hours after the start");
}
}
}
}