#C11439. Digital Clock Conversion
Digital Clock Conversion
Digital Clock Conversion
You are given an integer representing the total number of seconds elapsed since midnight. Your task is to convert this integer into a 24-hour time format string HH:MM:SS.
The conversion should satisfy the following conditions:
- If \(0 \leq \text{seconds} < 86400\), format the time such that hours, minutes, and seconds are each represented with two digits (using leading zeros if necessary).
- If the input is out of the valid range (i.e. \(\text{seconds} < 0\) or \(\text{seconds} \geq 86400\)), output "Invalid input!".
For example, an input of 3661
should return "01:01:01".
inputFormat
The input consists of a single integer \(seconds\) provided via stdin
representing the total elapsed seconds since midnight.
outputFormat
Output a single string to stdout
that is either the formatted time in "HH:MM:SS" or the string "Invalid input!" if the input is out of range.
0
00:00:00