Editorial for COCI '06 Contest 5 #2 Natrij
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
For both given times, we'll calculate the number of seconds elapsed since the current day started. For the starting time, that number is
Subtracting the two numbers we get the number of seconds between the two times. This needs to be converted into hours, minutes and seconds.
Also note the case when the given times are equal. The task description says that 24 hours should be output, not 0.
Comments