Write a program that checks whether two time intervals overlap. This is a common problem solved by scheduling systems, as for example you cannot be enrolled in two classes that happen at the same time or be in two meetings that happen at the same time.
Each line of input will consist of four points in time t₀, t₁, t₂ and t₃ separated by a single space. The first time interval starts at t₀ and ends at t₁ and the second time interval starts at t₂ and ends at t₃. The four points t₀, t₁, t₂ and t₃ are in the format HH:MM where HH indicates the hour and MM indicate the minutes.
For each line of input, your program should produce a line of output
indicating whether there is an overlap between the intervals
t₀-t₁ and t₂-t₃.
Input is given so that t₀ < t₁, t₂ < t₃, t₀ ≠ t₂, t₀ ≠ t₃, t₁ ≠ t₂ and t₁ ≠ t₃.
13:37 15:59 16:00 17:00 14:00 15:00 14:30 15:30
You can more easily compare the timestamps by converting them to a single integer indicating the number of minutes since midnight.
To read the hour and minutes of each timestamp you will need to split at the colon
scanf(" %d:%d", &h, &m);
:by using the function
(hh,':':mm) = break (==':') s.
try also: discount
Copyright © 2020-2021 Rudy Matela
All rights reserved