
Time Conversion
Adapted by Neilor Tonin, URI Brazil
Read an integer value, which is the duration in seconds of a certain event in a factory, and inform it expressed in hours:minutes:seconds.
Input
The input file contains an integer N.
Output
Print the read time in the input file (seconds) converted in hours:minutes:seconds like the following example.
Input Sample | Output Sample |
556 |
0:9:16 |
1 |
0:0:1 |
140153 |
38:55:53 |
N.B.: It's better if you solve this by your own. Thank you!
URI - BEECROWD Online Judge 1019 Solve in C :
//Solved by Intesar#include <stdio.h>
int main() {
int hour,min,sec; scanf("%d",&sec); hour=sec/3600; sec=sec-(hour*3600); min=sec/60; sec=sec-(min*60); printf("%d:%d:%d\n",hour,min,sec);
return 0;}
0 Comments