← All problemsSign in

Time Conversion

Given a time in -hour AM/PM format, convert it to military (-hour) time. Note: Midnight is on a -hour clock, and on a -hour clock. Noon is on a -hour clock, and on a -hour clock. Input Format A single string containing a time in -hour clock format (i.e.: or ), where and . Output Format Convert and print the given time in -hour format, where . Sample Input 07:05:45PM Sample Output 19:05:45

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start