Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _03.On_Time_for_the_Exam
- {
- class Program
- {
- static void Main(string[] args)
- {
- int examHour = int.Parse(Console.ReadLine());
- int examMinute = int.Parse(Console.ReadLine());
- int hourOfArriaval = int.Parse(Console.ReadLine());
- int minuteOfArriaval = int.Parse(Console.ReadLine());
- int totalExam = examMinute + (examHour * 60);
- int totalArrival = (hourOfArriaval * 60) + minuteOfArriaval;
- int result = totalArrival - totalExam; //kind of...
- int onTime = totalExam - totalArrival; //and early
- int hours = result / 60;
- int min = result % 60;
- if (totalExam < totalArrival)
- {
- Console.WriteLine("Late");
- if (hours == 0)
- {
- if (min < 10)
- Console.WriteLine($"0{min} minutes after the start");
- else
- Console.WriteLine($"{min} minutes after the start");
- }
- else
- {
- if (min < 10)
- Console.WriteLine($"{hours}:0{min} hours after the start");
- else
- Console.WriteLine($"{hours}:{min} hours after the start");
- }
- }
- else if (onTime <= 30)
- {
- Console.WriteLine("On time");
- min = onTime % 60;
- if (onTime == 0)
- {
- }
- else
- Console.WriteLine($"{min} minutes before the start");
- }
- else if (onTime > 30)
- {
- Console.WriteLine("Early");
- hours = onTime / 60;
- min = onTime % 60;
- if (hours == 0)
- {
- if (min < 10)
- Console.WriteLine($"0{min} minutes before the start");
- else
- Console.WriteLine($"{min} minutes before the start");
- }
- else
- {
- if (min < 10)
- Console.WriteLine($"{hours}:0{min} hours before the start");
- else
- Console.WriteLine($"{hours}:{min} hours before the start");
- }
- ///help :( only 93 of 100 in judge...
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement