Wuhan University of Science and Technology acm:1009: Chinese Edition C language Programming tutorial (second Edition) example 5.4

Source: Internet
Author: User

Problem Description

The teacher gave a title to Xiao Hao: give you a value of n (within 32 bits) in seconds, let you convert to: minutes: seconds output. Now that little Howe is in a quandary, please help him solve the problem.

Input

Enter a positive integer of n seconds per line.

Output

for each set of test data, output a row of results: minutes: seconds. (24-hour system)

Sample Input
560
Sample Output
00:00:0500:01:00
HINT

#include <stdio.h>intHh,mm,ss;voidConvertime (Longsec) {hh=sec/3600; MM= (sec-hh*3600L)/ -; SS=sec-hh*3600L-mm* -;}intMain () {Longsecs;  while(SCANF ("%ld", &secs)! =EOF) {       if(secs>=86400) {secs=secs%86400;        } convertime (secs); printf ("%02d:%02d:%02d\n", HH,MM,SS); }    return 1;}

Wuhan University of Science and Technology acm:1009: Chinese Edition C language Programming tutorial (second Edition) example 5.4

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.