Get Time in Words

3.2

17 votes
Easy-Medium
Problem

Given the time in digital format, you are supposed to change it into words from, like:

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

Implement a program which prints the time in words for the given input time 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

Get the time in words....

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

?