http://acm.hdu.edu.cn/showproblem.php?pid=2076
没什么技巧,注意输出数据的类型即可
Problem : 2076 ( 夹角有多大(题目已修改,注意读题) ) Judge Status : Accepted
RunId : 3081851 Language : G++ Author : rll
Code Render Status : Rendered By HDOJ G++ Code Render Version 0.01 Beta
RunId : 3081851 Language : G++ Author : rll
Code Render Status : Rendered By HDOJ G++ Code Render Version 0.01 Beta
代码
1 #include<stdio.h>
2 #include<math.h>
3 int main()
4 {
5 int n,i,h,m,s,t;
6 double des;
7 scanf("%d",&n);
8 while(n--)
9 {
10 scanf("%d%d%d",&h,&m,&s);
11 if(h>12)
12 h=h-12;
13
14
15 des=fabs(30*h-11.0*m/2-11.0*s/120);
16 if(des>180)t=(int)360-des;
17 else t=(int)des;
18 printf("%d\n",t);
19 }
20 return 0;
21 }