Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- var hourExam = int.Parse(Console.ReadLine());
- var minuteExam = int.Parse(Console.ReadLine());
- var hourArrive = int.Parse(Console.ReadLine());
- var minuteArrive = int.Parse(Console.ReadLine());
- var hourExamInMinutes = hourExam*60;
- var hourArriveInMinutes = hourArrive*60;
- var hourExamTotal = hourExamInMinutes + minuteExam;
- var hourArriveTotal = hourArriveInMinutes + minuteArrive;
- if ((hourExamTotal - hourArriveTotal)>=0 && (hourExamTotal - hourArriveTotal)<=30)
- {
- Console.WriteLine("On time");
- }
- else if ((hourArriveTotal - hourExamTotal)>0)
- {
- Console.WriteLine("Late");
- }
- else
- {
- Console.WriteLine("Early");
- }
- if ((hourExamTotal - hourArriveTotal)>=0 && (hourExamTotal - hourArriveTotal)<60)
- {
- Console.WriteLine("{0} minutes before the start",Math.Abs(hourExamTotal - hourArriveTotal));
- }
- else if ((hourExamTotal - hourArriveTotal)>=60)
- {
- int hours = Math.Abs(hourExamTotal - hourArriveTotal)/60;
- int minutes = Math.Abs(hourExamTotal - hourArriveTotal)%60;
- Console.WriteLine("{0}:{1:00} hours before the start",hours, minutes);
- }
- else if ((hourArriveTotal - hourExamTotal) >=0 && (hourArriveTotal - hourExamTotal) <60)
- {
- Console.WriteLine("{0} minutes after the start",Math.Abs(hourExamTotal - hourArriveTotal));
- }
- else if ((hourArriveTotal -hourExamTotal>=60))
- {
- int hours = Math.Abs(hourExamTotal - hourArriveTotal)/60;
- int minutes = Math.Abs(hourExamTotal - hourArriveTotal)%60;
- Console.WriteLine("{0}:{1:00} hours after the start",hours, minutes);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement