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