Write a program that asks the user to enter a 24-hour time, then the output display 12 hours of time,
Input format:
In the line with intermediate input: symbol (half Angle of colon) 24-hour time, hours and minutes adopt two digital formats, such as 18 points and 14 points, all said 09:06 said 9, 6 points,
The output format:
In a row in the output corresponding to the time of 12 hours of time, the digital part of the format the same as the input, and then keep up with the space, to keep up with the said morning AM string or said the string of PM in the afternoon, at 5 PM, 6 points such as 05:06 PM said,
Note: in the habit of English, 12 noon is considered to be in the afternoon, so the 24-hour 12:00 is 12 hours of 12:00 PM. The 12 o 'clock at night (24:00) is considered to be the next day, so is 12:00 AM,
Input the sample:
20:09
The output sample:
08:09 PM
Time limit: 500 ms memory limit: 32000 KB
CodePudding user response: