1999 LSU Computer Science High School Programming Contest
Novice and Veteran Problem 4
How long have you been waiting?

Do you ever get tired of waiting for something to happen? The Gotta-Have-It Gadget Company thinks there is a market for a small device that can tell you how long you have been waiting. In its normal mode, it simply counts the minutes from start to stop. In the advanced mode, you can enter a start time and a stop time and it will tell you how many minutes have elapsed.

The Gotta-Have-It Gadget Company has hired you to program the advanced option. You are to write a program that will accept two times and determine how much time has transpired between them. Times will be entered in a 24-hour format. The first time will always be before the second time (but it may be larger - from 21:01 to 7:11 is 590 minutes). Your input will be the times in hours and minutes (HHMM - 21:01 would be 2101 for input). Your program should stop when the start time is 0. One minute after midnight would be represented as 1 (0 hours).

Sample Input Data:

2101 
711
2359 
1
1158 
1159
0

Sample Output:

From 21:01 to 7:11 is 609 minutes.
From 23:59 to 0:1 is 2 minutes.
From 11:58 to 11:59 is 1 minute.

NOTE: Do not worry about the formatting of numeric output (leading/trailing spaces around numbers are acceptable). Leading zeroes are not required in times.



Return to the Top of Page, First Page, Novice Problem Set, or Veteran Problem Set.


Clarifications:







Return to the Top of Page, First Page, Novice Problem Set, or Veteran Problem Set.



The statements and opinions included in these pages are those of the LSU High School Programming Contest Staff only. Any statements and opinions included in these pages are not those of Louisiana State University or the LSU Board of Supervisors.
© 1999 LSU High School Programming Contest

Return to the LSU High School Programming Contest Homepage