UVA10339 watching Watches

Source: Internet
Author: User

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

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.