Military Time Conversion
CodeChefOpen on judge ↗
Q1. Write a program to convert a 12-hour time in AM/PM format to military (24-hour) time. A 12-hour clock's 12:00:00 AM is equivalent to 00:00:00 AM on a 24-hour clock, and vice versa for 12:00:00 PM. ### Input - A single string s that represents a time in 12-hour clock format (i.e.: or ). ### Output - the time in hour format ### Constraints - All input times are valid ### Subtasks - **Subtask
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.
Sign in to chat with the tutor and save your progress.
Sign in to start