Medium25 pts
The Time in Words
Convert numeric time (h:m) to words. Rules: m=0 → 'h o' clock', m=15 → 'quarter past h', m=30 → 'half past h', m=45 → 'quarter to h+1', 1≤m≤30 → 'm minutes past h', m>30 → '(60-m) minutes to h+1'. Example: 5:47 → 60-47=13 → 'thirteen minutes to six'. 3:00 → 'three o' clock'. 7:15 → 'quarter past seven'
Input
First line: h (1-12). Second line: m (0-59).
Output
The time in words as a string.
Sample
5 47
Expected
thirteen minutes to six
Loading editor…
Output
No output yet. Run your code to see results.