Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Globalization;
- class Program
- {
- static void Main()
- {
- int examHour = int.Parse(Console.ReadLine());
- int examMinute = int.Parse(Console.ReadLine());
- int comeHour = int.Parse(Console.ReadLine());
- int comeMinute = int.Parse(Console.ReadLine());
- int start = examHour * 60 + examMinute;
- int come = comeHour * 60 + comeMinute;
- if (start > come && start - come < 60 && start - come <= 30)
- {
- Console.WriteLine("On time {0} minutes before the start", start - come);
- }
- else if (start > come && start - come > 60 && start - come <= 30)
- {
- Console.WriteLine("On time {0}:{1} hours before the start", (start - come) / 60, (start - come) % 60);
- }
- else if (start < come && come - start < 60)
- {
- Console.WriteLine("Late {0} minutes after the start", come - start);
- }
- else if (start < come && come - start >= 60)
- {
- Console.WriteLine("Late {0}:{1} hours after the start", (come - start) / 60, (come - start) % 60);
- }
- else if (start == come)
- {
- Console.WriteLine("On time");
- }
- else if (start > come && start - come > 30 && start - come < 60)
- {
- Console.WriteLine("Early {0} minutes before the start", start - come);
- }
- else if (start > come && start - come > 30 && start - come > 60)
- {
- Console.WriteLine("Early {0}:{1} hours before the start", (start - come) / 60, (start - come) % 60);
- }
- else if (start > come && start - come > 30 && start - come == 60)
- {
- Console.WriteLine("Early {0}:00 hours before the start", (start - come) / 60);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement