hdoj2180时钟
来源:互联网 发布:安吉丽娜朱莉离婚 知乎 编辑:程序博客网 时间:2024/06/14 09:13
时钟
Time Limit : 3000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)
Total Submission(s) : 35 Accepted Submission(s) : 12
Problem Description
从a点b分到s点t分时针和分针重合多少次?
Input
有多组数据,每组1行4个数 a,b,s,t. 1<=a,s <=12, 0<=b,t<60. 0 0 0 0结束.
Output
参看Sample output
Sample Input
12 50 1 2
3 8 3 20
2 45 11 0
11 0 3 20
1 2 12 50
3 20 3 8
0 0 0 0
Sample Output
0
1
8
4
11
10
Time Limit : 3000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)
Total Submission(s) : 35 Accepted Submission(s) : 12
Problem Description
从a点b分到s点t分时针和分针重合多少次?
Input
有多组数据,每组1行4个数 a,b,s,t. 1<=a,s <=12, 0<=b,t<60. 0 0 0 0结束.
Output
参看Sample output
Sample Input
12 50 1 2
3 8 3 20
2 45 11 0
11 0 3 20
1 2 12 50
3 20 3 8
0 0 0 0
Sample Output
0
1
8
4
11
10
代码:
#include<stdio.h>int main(){ int a,b,c,y,d;double i,k; while (~scanf("%d%d%d%d",&a,&b,&c,&d) && (a||b||c||d)) { a=a*60+b; c=c*60+d; if (a>=c) c+=720;k=c*11+0.1;i=a*11+0.1; y=(int)k/720-(int)i/720; if (a==720) y++; printf("%d\n",y); } return 0;}
0 0
- hdoj2180时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- 时钟
- hdoj5053the Sum of Cube
- vmware linux虚拟机 复制后不能上网
- YARN服务库和事件库的使用方法(1)
- 【GLSL教程】(一)图形流水线
- SSH集成下OpenSessionInViewFilter无效不起作用
- hdoj2180时钟
- 【GLSL教程】(二)在OpenGL中使用GLSL
- 事件驱动带来的变化
- response跳转的路径问题
- mysql触发器实例收集
- 5.3.3 deque对象
- 模拟继承
- 选择器(标签,class,id,子,后代,通用,伪类,分组)区别,继承,<link>
- win7与VMware ubuntu虚拟机实现文件共享(最后一定要装open-vm-dkms插件)