Military to Standard Time

1

1 votes
Problem

Write a program, which reads in two integers -- the hour and minute in military time (so hours run from 0 to 23, minutes from 0 to 59) -- and prints out the same time in standard time. For example, your program may run like this (with user input underlined):

Enter the hour in military time: 3
Enter the minute: 17
The current time is: 3:17 a.m.

or:

Enter the hour in military time: 14
Enter the minute: 32
The current time is: 2:32 p.m.


Input Format:
You will input two numbers separated by space which will represent the hour and the minute of the time respectively.


Output Format:
Display a string that says, “The current time is: “ then the result time in standard format (hh:mm a.m. or p.m.)


Reminder:
A common mistake is to fail to handle the first hour of the day properly -- be sure that 0:17 (or 24:17) maps to 12:17am.

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

?