URI - BEECROWD - BEE Online Judge Solution 1019 | Time Conversion - URI - BEECROWD - BEE 1019 Solution in C,C++,Python
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 |
URI Online Judge Solution 1019 | Time Conversion - URI 1019 Solution in C,C++,Python:
#include <stdio.h>
int main()
{
int seconds;
scanf("%d", &seconds);
int hours = seconds / 3600;
seconds = seconds - (hours * 3600);
int minutes = seconds / 60;
seconds = seconds - (minutes * 60);
printf("%d:%d:%d\n", hours, minutes, seconds);
return 0;
}
0 Response to URI - BEECROWD - BEE 1019 | Time Conversion Solution in C,C++,Python
Post a Comment