Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MyApp // Note: actual namespace depends on the project name.
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int hours = int.Parse(Console.ReadLine());
- int minutes = int.Parse(Console.ReadLine());
- int hoursIn = int.Parse(Console.ReadLine());
- int minutesIn = int.Parse(Console.ReadLine());
- int hh = 0 , mm = 0 , allTime = 0 , timeCome = 0;
- allTime = (hours * 60) + minutes;
- timeCome = (hoursIn * 60) + minutesIn;
- if (allTime >= timeCome )
- {
- hh = (allTime - timeCome) / 60;
- mm = (allTime - timeCome) % 60;
- if (hh == 0)
- {
- if (mm == 0 )
- {
- Console.WriteLine("On time");
- }
- else if (mm <=30)
- {
- Console.WriteLine("On time");
- Console.WriteLine($"{mm} minutes before the start");
- }
- else
- {
- Console.WriteLine("Early");
- Console.WriteLine($"{mm} minutes before the start");
- }
- }
- else
- {
- if (mm < 10)
- {
- Console.WriteLine("Early");
- Console.WriteLine($"{hh}:0{mm} hours before the start");
- }
- else
- {
- Console.WriteLine("Early");
- Console.WriteLine($"{hh}:{mm} hours before the start");
- }
- }
- }
- else
- {
- hh = (timeCome -allTime) / 60;
- mm = (timeCome -allTime) % 60;
- if (hh == 0)
- {
- Console.WriteLine("Late");
- Console.WriteLine($"{mm} minutes after the start");
- }
- else
- {
- Console.WriteLine("Late");
- Console.WriteLine($"{hh}:{mm} hours after the start");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement