题目大意:有两个表,每天都会慢一点时间,给出每天慢得秒数,问下一次重合的时刻。

解题思路:时刻重合也就是说整整差了一周,一周是12小时,用12小时的秒数除以两个表的相差那就是需要多少天的时间后重合,知道了需要多少天*每一天某个表走的时间(注意要减去少走的时间)即使答案,化成时间的格式即可,注意0时显示成12时。

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m, c, h, t1, t2;
    double t3;
    long long n;
    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;
        *-t1);
        n %=;
        m=n/;
        n%=;
        ) m++;
        h=m/;
        m%=;
        ) h=;
        printf("%d %d %02d:%02d\n",t1,t2,h,m);
    }
    ;
}

UVA10339 Watching Watches的更多相关文章

  1. Uva 10339 - Watching Watches【数论,暴力】

    题目链接:10339 - Watching Watches 题意:两个时钟,一个每天慢a秒,一个每天慢b秒,问两钟重新相遇的时刻 1圈有12 * 60 * 60秒,然后1圈 / abs(a - b), ...

  2. UVA - 10339-Watching Watches

    10339 - Watching Watches Time limit: 3.000 seconds It has been said that a watch that is stopped kee ...

  3. Zookeeper 监视(Watches) 简介(转)

    Zookeeper C API 的声明和描述在 include/zookeeper.h 中可以找到,另外大部分的 Zookeeper C API 常量.结构体声明也在 zookeeper.h 中,如果 ...

  4. Codeforces Round #219 (Div. 1) C. Watching Fireworks is Fun

    C. Watching Fireworks is Fun time limit per test 4 seconds memory limit per test 256 megabytes input ...

  5. Codeforces Round #219 (Div. 2) E. Watching Fireworks is Fun

    http://codeforces.com/contest/373/problem/E E. Watching Fireworks is Fun time limit per test 4 secon ...

  6. 6656 Watching the Kangaroo

    6656 Watching the KangarooDay by day number of Kangaroos is decreasing just liketiger, whale or lion ...

  7. Error watching file for changes: EMFILE

    运行reactnative项目时在编译过程中报错 Error watching file for changes: EMFILE 故障原因: 是升级后watchman不可用了,需要重装watchman ...

  8. Listen error 错误和 limit of inotify watches was reached

    今天在生产环境中报错rails c中报了一个错误: FATAL: Listen error: unable to monitor directories for changes. Visit http ...

  9. Containerpilot 配置文件 之 Watches

    watch是在consul进行监视的服务配置. watch轮询服务的状态,并在服务变得健康,变得不健康或者实例数量发生变化时发出事件. 请注意,watch不包括行为; watch只发出事件,以便job ...

随机推荐

  1. MVC模型 简介

    MVC (Modal View Controler)本来是存在于Desktop程序中的,M是指数据模型,V是指用户界面,C则是控制器.使用MVC的目的是将M和V的实现代码分离,从而使同一个程序可以使用 ...

  2. 05---Net基础加强

    接口 public class Program { static void Main(string[] args) { IFlyable sp = new SupperMan(); sp.Fly(); ...

  3. zw版【转发·台湾nvp系列Delphi例程】HALCON SetGray

    zw版[转发·台湾nvp系列Delphi例程]HALCON SetGray SetGray_Delphi.PNG unit Unit1;interfaceuses Windows, Messages, ...

  4. C++之: CDib类

    头文件Cdib.h 源文件Cdib.cpp

  5. HAVING用法详解

    HAVING 子句对 GROUP BY 子句设置条件的方式与 WHERE 和 SELECT 的交互方式类似.WHERE 搜索条件在进行分组操作之前应用:而 HAVING 搜索条件在进行分组操作之后应用 ...

  6. delphi注册/反注册OCX

    uses ShellAPI; function ExecAndWait(const ExecuteFile, ParamString : string): boolean; var SEInfo: T ...

  7. bootstrap导航条在手机上默认展开二级目录,必须用setTimeout才能实现

    bootstrap导航条在手机上默认展开二级目录,必须用setTimeout才能实现 $(document).ready(function() { $('.dropdown').hover(funct ...

  8. [Android新手区] SQLite 操作详解--SQL语法

    该文章完全摘自转自:北大青鸟[Android新手区] SQLite 操作详解--SQL语法  :http://home.bdqn.cn/thread-49363-1-1.html SQLite库可以解 ...

  9. 【转载】Perl异常处理方法总结

    程序脚本在运行过程中,总会碰到这样那样的问题,我们会预知一些问题并为其准备好处理代码,而有一些不能预知.好的程序要能尽可能多的处理可能出现的异常问题,本文就总结了一些方法来解决这些异常,当然perl在 ...

  10. restful 注解

    @Path @Path 注释被用来描述根资源.子资源方法或子资源的位置.value 值可以包含文本字符.变量或具有定制正则表达式的变量. @GET.@POST.@PUT.@DELETE.@HEAD @ ...