http://acm.hdu.edu.cn/showproblem.php?pid=2076
#include <bits/stdc++.h>
using namespace std;
int main() {
int T;
scanf("%d", &T);
for(int i = 1; i <= T; i ++) {
double h, m, s;
scanf("%lf%lf%lf", &h, &m, &s);
if(h>=12) h-=12;
m = m + s / 60.0;
h = h + m / 60.0;
double out = 0;
out = fabs(h * 30.0 - m * 6.0);
printf("%d\n", (int)min(out, 360 - out));
}
return 0;
}
原文:https://www.cnblogs.com/zlrrrr/p/9380186.html