Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Exam9
- {
- class Program
- {
- static void Main(string[] args)
- {
- int hourOfExam = int.Parse(Console.ReadLine());
- int minutesOfExam = int.Parse(Console.ReadLine());
- int hourOfArrival = int.Parse(Console.ReadLine());
- int minutesOfArrival = int.Parse(Console.ReadLine());
- int totalExamMinutes = hourOfExam * 60 + minutesOfExam;
- int totalArrivalMinutes = hourOfArrival * 60 + minutesOfArrival;
- int difference = Math.Abs(totalExamMinutes - totalArrivalMinutes);
- int differenceHour = difference / 60;
- int differenceMinutes = difference % 60;
- if (totalArrivalMinutes > totalExamMinutes)
- {
- Console.WriteLine("Late");
- if (difference < 60)
- {
- Console.WriteLine($"{differenceMinutes} minutes after the start");
- }
- else if (difference >= 60)
- {
- Console.WriteLine($"{differenceHour}:{differenceMinutes:D2} hours after the start");
- }
- }
- else if (totalArrivalMinutes == totalExamMinutes || difference <= 30)
- {
- Console.WriteLine("On time");
- if (difference <= 30)
- {
- Console.WriteLine($"{differenceMinutes} minutes before the start");
- }
- }
- else if (difference > 30)
- {
- Console.WriteLine("Early");
- if (difference < 60)
- {
- Console.WriteLine($"{differenceMinutes} minutes before the start");
- }
- else if (difference >= 60)
- {
- Console.WriteLine($"{differenceHour}:{differenceMinutes:D2} hours before the start");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement