#include <algorithm>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int n;
cin >> n;
while (n--) {
int h, m, s;
cin >> h >> m >> s;
if (h >= 12)
h -= 12;
/* cout << h << " " << m << " " << s << endl; */
double ho = (double)h * 30 + (double)m / 2 + (double)s / 120;
double mi = (double)m * 6 + (double)s / 10;
/* cout << ho << " " << mi << endl; */
double temp = abs(ho - mi);
double ans = temp > 180 ? (360 - temp) : temp;
cout << (int)floor(ans) << endl;
}
return 0;
}
杭电OJ 2076 夹角有多大(题目已修改,注意读题) C++
最新推荐文章于 2024-05-11 23:46:05 发布