UVA10339 Watching Watches

题目大意:有两个表,每天都会慢一点时间,给出每天慢得秒数,问下一次重合的时刻。
解题思路:时刻重合也就是说整整差了一周,一周是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的更多相关文章
- Uva 10339 - Watching Watches【数论,暴力】
题目链接:10339 - Watching Watches 题意:两个时钟,一个每天慢a秒,一个每天慢b秒,问两钟重新相遇的时刻 1圈有12 * 60 * 60秒,然后1圈 / abs(a - b), ...
- UVA - 10339-Watching Watches
10339 - Watching Watches Time limit: 3.000 seconds It has been said that a watch that is stopped kee ...
- Zookeeper 监视(Watches) 简介(转)
Zookeeper C API 的声明和描述在 include/zookeeper.h 中可以找到,另外大部分的 Zookeeper C API 常量.结构体声明也在 zookeeper.h 中,如果 ...
- 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 ...
- 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 ...
- 6656 Watching the Kangaroo
6656 Watching the KangarooDay by day number of Kangaroos is decreasing just liketiger, whale or lion ...
- Error watching file for changes: EMFILE
运行reactnative项目时在编译过程中报错 Error watching file for changes: EMFILE 故障原因: 是升级后watchman不可用了,需要重装watchman ...
- Listen error 错误和 limit of inotify watches was reached
今天在生产环境中报错rails c中报了一个错误: FATAL: Listen error: unable to monitor directories for changes. Visit http ...
- Containerpilot 配置文件 之 Watches
watch是在consul进行监视的服务配置. watch轮询服务的状态,并在服务变得健康,变得不健康或者实例数量发生变化时发出事件. 请注意,watch不包括行为; watch只发出事件,以便job ...
随机推荐
- Java -verbose:gc 命令
Java -verbose:gc 中参数-verbose:gc 表示输出虚拟机中GC的详细情况. [Full GC 168K->97K(1984K), 0.0253873 secs] 解读如 ...
- ssh-copy-id帮你建立信任
一.ssh-keygen -t rsa [nameA@machineA]$ ssh-keygen -t rsa Generating public/private rsa key pair. Ente ...
- 夺命雷公狗jquery---3普通选择器
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- [php] 判断当前运行模式
//判断是否cgi模式 define('IS_CGI',substr(PHP_SAPI, 0,3)=='cgi' ? 1 : 0 ); //判断操作系统是否为windows define('IS_WI ...
- 五、Java基础---------if else、switch总结
在前几篇博客中主要是以笔者遇到的一些典型的题目为例子而展开的讨论,接下来几篇将是以知识点的结构进行讲述.本文主要是讲述if ()else .if() else if().switch() case 的 ...
- 三、Java基础---------关于继承、构造函数、静态代码块执行顺序示例讲解
在上节博客中曾提到过类的继承,这篇文章主要是介绍类的继承.构造函数以及静态代码块的执行顺序. 首先接着分析在黑马基础测试中的一个关于继承的题目,题目描述如下: 声明类Person,包含2个成员变量:n ...
- jboss-as 目录结构(转)
jboss-as 目录结构(Directory Structure) Directory Description bin Contains startup, shutdown and other sy ...
- uml定义的使用的关系
uml定义的关系主要有六种:依赖.类属.关联.实现.聚合和组合.下面对其定义和表示方法逐一说明. 依赖 (Dependency):元素A的变化会影响元素B,但反之不成立,那么B和A的关系是依赖关系,B ...
- 上海某(hong)冠笔试题
1.解释Spring的ioc和aop 首先想说说IoC(Inversion of Control,控制倒转).这是spring的核心,贯穿始终.所谓IoC,对于spring框架来说,就是由spring ...
- Aspose.Words操作word生成PDF文档
Aspose.Words操作word生成PDF文档 using Aspose.Words; using System; using System.Collections.Generic; using ...