URI Online Judge Solution| 1019 Time Conversion

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

URI Online Judge | 1019

Time Conversion

Adapted by Neilor Tonin, URI  Brazil |Timelimit: 1

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 SampleOutput Sample
5560:9:16
10:0:1
14015338:55:53

Solution

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

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

Do You Want To Contact With me?

drop us a line and keep in touch