2670 Time Calculation

Source: Internet
Author: User

2670 Time Calculation

time limit: 2 sspace limit: 32000 KBtitle level: Golden Gold SolvingView Run ResultsTitle Description Description

Let's say it's January 1, 2013.0:00 minutes 00 seconds, now give a second s, after s seconds, when that month that day, when a few seconds. (set 30 days per month)

Enter a description Input Description

(majority) a positive integer per line s, when s=0, the input ends.

Output description Output Description

Xnxyxrx:x:x per line (hours to 24-hour format)

Sample input Sample Input

5

100

86400

0

Sample output Sample Output

2013n1y1r00:00:05

2013n1y1r00:01:40

2013n1y2r00:00:00

Data range and Tips Data Size & Hint

"Data Range"

For 50% data s≤20,000, the number of data groups ≤1000

For 100% data s≤100,000, the number of data groups ≤5000

Prompted

0:00:05 Press 0:0:5 output to calculate the error

Category labels Tags Click here to expand

Attention to the topic requirements, data range

#include <cstdio>using namespacestd;intN,y,m,d,shi,fen,miao;intMain () { while(1) {scanf ("%d",&N); if(n==0)return 0; Y=m=d=shi=fen=miao=0; Y=n/31104000; N%=31104000; M=n/2592000; N%=2592000; D=n/86400; N%=86400; Shi=n/3600; N%=3600; Fen=n/ -; N%= -; Miao=N; printf ("%DN%DY%DR", y+ -, m+1, d+1); if(shi<Ten) printf ("0%d:", Shi); Elseprintf"%d:", Shi); if(fen<Ten) printf ("0%d:", Fen); Elseprintf"%d:", Fen); if(miao<Ten) printf ("0%d\n", Miao); Elseprintf"%d\n", Miao); }    return 0;}

2670 Time Calculation

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.