[BIO97 Logo] The British Informatics Olympiad
Sponsored by Data Connection.
[Data Connection logo]
-----

The 1997 British Informatics Olympiad Round One

Question 1

Question 1
Time
Given a time in numbers we can convert it into words. For example:

5:00 Five o'clock
5:10 Ten minutes past five
5:15 Quarter past five
5:30 Half past five
5:45 Quarter to six
5:47 Thirteen minutes to six

1 (a)
[20 marks]

Write a program which inputs two numbers (the first between 1 and 12, the second between 0 and 59 inclusive) and then prints out the time they represent, in words. You should follow the format of the examples above. Your program should then terminate.

Sample run
Hours: 4
Minutes:
12
Twelve minutes past four
1 (b)
[5 marks]
Which times, when written in words, have the longest length?

The British Informatics Olympiad - BIO'97 exam - BIO'98 sample paper