Seconds to Time

Lab C Beginner 10 points

Read a number of seconds and print it as HH:MM:SS, each part with two digits.

Input

One integer 0–86399.

Output

One line.

Example

Input

3725

Output

01:02:05
Sample input available Sample output available
Editor
C

Hints

%02d pads with a leading zero to 2 digits.

Solution explanation

/ and % split a number into units.

Show solution
#include <stdio.h>

int main() {
    int t;
    scanf("%d", &t);
    printf("%02d:%02d:%02d\n", t / 3600, t % 3600 / 60, t % 60);
    return 0;
}
Output
Answer
HOME LEARN COMMUNITY DASHBOARD