The main topic: there are two tables, each day will be a little slower, give the number of seconds per day, ask the next time coincident.
Problem-solving ideas: Time coincidence that is a whole week, a week is 12 hours, 12 hours in seconds divided by two table difference that is how many days after the time of coincidence, know how many days * each day a table walking time (note to subtract less time to walk) even if the answer, the format of the time can be, Note 0 o'clock is displayed as 12 o'clock.
#include <bits/stdc++.h>using namespacestd;intMain () {intm, C, H, T1, T2; DoubleT3; Long LongN; while(~SCANF ("%d%d",&t1,&T2)) { if(t1==T2) {printf ("%d%d 12:00\n", T1,T2); Continue; } C=abs (t1-T2); T3=12.0*3600.0/C; Long Longn=t3* ( -*3600-t1); N%=43200; M=n/ -; N%= -; if(n>= -) m++; H=m/ -; M%= -; if(h==0) h= A; printf ("%d%d%02d:%02d\n", t1,t2,h,m); } return 0;}
UVA10339 watching Watches