|
|||
Calculating Flight DurationNaaah! Yet another time you receive a flight ticket and have to calculate how long your flight takes using confusing format that the airlines use to describe the departure/arrival times. But this time, you decide to solve this problem once and for all by writing a program to calculate the flight duration! For simplicity, in the first version of the problem, you only handle non-stop flights. Input SpecificationThe input contains several test cases. Each test case describes a non-stop flight on a single line of the input. Each flight description begins with a flight number (a string of at least 2, at most 7 alphanumeric characters) followed by the departing city name, time zone, and the departure time, and then the arriving city name, time zone, and the arrival time. City names are strings of at least 1, at most 9 alphanumeric characters.
The time zone is written as a number inside a pair of parentheses with the format
shown in the sample input, like
The flight times are described in the format shown in the sample input, e.g.
The end of input is specified by a single line containing a single “#” character which should not be processed. Output Specification
For each test case, output a single line containing the flight number, one space
character, and the duration of the flight. The duration must be of the form
Sample Input
Output for Sample Input
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |