Table of Contents

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;
}
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest
Share on whatsapp
WhatsApp
Share on email
Email
Md. Nurnobi Hosen
Md. Nurnobi Hosen

Student of Computer Science and Engineering at Daffodil International University,Main Campus ,Dhanmondi.
Web and App Developer also expart of wordpress customization

All Blog Posts »
Subscribe
Notify of
guest
2 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
oprolevorter
oprolevorter
December 7, 2019 6:49 PM

Thank you for any other excellent article. The place else could anybody get that type of information in such a perfect way of writing? I have a presentation next week, and I’m at the search for such information.

oprolevorter
oprolevorter
December 11, 2019 5:10 AM

But wanna input that you have a very decent website , I like the style it actually stands out.

2
0
Would love your thoughts, please comment.x
()
x