12004 - Digital Clock   

Description

Given an integer t representing a time in seconds, output the time in hh:mm:ss format (24-hour).

For example, if t = 12345, then output "03:25:45" (without the quotes); if t = 0, then output "00:00:00" (without the quotes).

 

Hint:

Please follow the format %02d:%02d:%02d when you use printf

A format specifier follows this prototype: %[flags][width][.precision][length]specifier 

width  
number Minimum number of characters to be printed. If the value to be printed is shorter than this number, the result is padded with blank spaces.

 

flag description
0 Printing with the 0 (zero) flag fills in leading zeros.

 

Example

code: printf("%09d", 762); 

output: 000000762

 

For more details, you can refer to the http://www.cplusplus.com/reference/cstdio/printf/

 

#include <stdio.h>
int main() {
    int t;
    scanf("%d", &t);
    printf("%02d:%02d:%02d\n", t/3600, (t%3600)/60, t%60);
    return 0;
}

Input

Input contains only a integer t, representing the time in seconds.

It is guaranteed that 0 <= t < 86400.

Output

Print out the 24-hour format of the time (format described above).

Note: for all the OJ submission (now and in future), unless the problem specify the special rule, you should always print a '\n' at the end of the output, or you might get a 'Presentation Error (PE)' or 'Wrong Answer (WA)' verdict.

Sample Input  Download

Sample Output  Download

Tags




Discuss