let's learn

URI Online Judge problem 1019 Solution


URI Online Judge problem 1019 Solution 

 


Problem:

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.

Sample 

Solution

In C language:

 #include<stdio.h>

int main()
{
    int N,hours,minutes,seconds;
    scanf("%d",&N);
    hours = N/3600;
    minutes = (N%3600)/60;
    seconds = N%60;
    printf("%d:%d:%d\n",hours,minutes,seconds);
    return 0;
}


To understand the program watch this video .
 

No comments

Powered by Blogger.