Get Time in Words now

2.9

11 votes
Problem

Given the time in numerals we may convert it into words, as shown below:

5:00→ five o' clock

5:01→ one minute past five

5:10→ ten minutes past five

5:30→ half past five

5:40→ twenty minutes to six

5:45→ quarter to six

5:47→ thirteen minutes to six

5:28→ twenty eight minutes past five

Write a program which prints the time in words for the input given in the format mentioned above.

Input Format

There will be two lines of input:

H, representing the hours

M, representing the minutes

Constraints

1≤H≤12

0≤M<60

Output Format

Display the time in words.

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?