Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _07OnTimeForTheExam
- {
- class Program
- {
- static void Main(string[] args)
- {
- int examH = int.Parse(Console.ReadLine());
- int examM = int.Parse(Console.ReadLine());
- int arrH = int.Parse(Console.ReadLine());
- int arrM = int.Parse(Console.ReadLine());
- int examTimeInMin = (examH * 60) + examM;
- int arrTimeInMin = (arrH * 60) + arrM;
- if (examTimeInMin < arrTimeInMin)
- {
- Console.WriteLine("Late");
- int diff = arrTimeInMin - examTimeInMin;
- if (diff<60)
- {
- Console.WriteLine("{0} minutes after the start",diff);
- }
- else
- {
- int diffMin = diff % 60;
- int diffHrs = diff / 60;
- Console.WriteLine("{0}:{1:D2} hours after the start",diffHrs,diffMin);
- }
- }
- else if (examTimeInMin == arrTimeInMin)
- {
- Console.WriteLine("On time");
- }
- else if (examTimeInMin - arrTimeInMin <=30)
- {
- Console.WriteLine("On time");
- int diff = examTimeInMin - arrTimeInMin;
- Console.WriteLine("{0} minutes before the start",diff);
- }
- else if (examTimeInMin - arrTimeInMin >30)
- {
- Console.WriteLine("Early");
- int diff = examTimeInMin - arrTimeInMin;
- if (diff<60)
- {
- Console.WriteLine("{0} minutes before the start", diff);
- }
- else
- {
- int diffMin = diff % 60;
- int diffHrs = diff / 60;
- Console.WriteLine("{0}:{1:D2} hours before the start", diffHrs, diffMin);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement