Thursday, May 26, 2016

URI Online Judge Solution 1019 || Time Conversion


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


URI Online Judge Solution 1019 || Time Conversion in C Language

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

URI Online Judge Solution 1019 || Time Conversion in C++ Language

#include <iostream>

using namespace std;

int main(){
    int a;
    
    cin >> a;
    
    cout << a/3600 << ":" << (a%3600)/60 << ":" << a%60 << endl;
    
    return 0;
}



Tags : URI Online Judge Solution 1019 , URI 1019 solution in C,  URI 1019 solution in C++, URI 1019 solution, URI Time Conversion Solution, URI 1019 problem solve

See or Download code from dropbox
See 1019 problem on URI

1 comment:
Write comments
  1. Good post man,,


    For basic problem solution you can follow my website.

    https://oloshcoder.org

    ReplyDelete

To know more about the problem, give us your valuable commment. We'll try to help you. Thanks

All rights reserved ©2016 -URI ONLINE JUDGE SOLUTION | Developed by Maniruzzaman Akash

© 2016 URI ONLINE JUDGE SOLUTION. Developed by Maniruzzaman Akash | Distributed By Gooyaabi Templates
Powered by Blogger.