URI ONLINE JUDGE SOLUTION 1019 - Time Conversion

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 input output

Solution

#include<stdio.h>
int main()
{
    int N, a[3];
    scanf("%d", &N);
    a[0] = N/3600;
    N = N%3600;
    a[1] = N/60;
    a[2] = N%60;
    printf("%d:%d:%d\n", a[0], a[1], a[2]);
    return 0;

}

Comments

Popular posts from this blog

URI ONLINE JUDGE SOLUTION 1021 - Banknotes and Coins

URI ONLINE JUDGE SOLUTION 1040 - Average 3

URI ONLINE JUDGE SOLUTION 1036 - Bhaskara's Formula