标签:tput -- back else turn main height gre title
2 8 3 17 5 13 30
138 75
#include <iostream> using namespace std; void calculateDegree(int h, int m, int s) { double mm = m * 6 + 0.1*s; double hh = h * 30 + 0.5*m + 0.5 / 60 * s; double diff = abs(hh - mm); int result; if (diff > 180) result = (int)(360 - diff); else result = (int)diff; cout << result << endl; } int main() { int T; int h, m, s; cin >> T; while (T--) { cin >> h >> m >> s; h = h % 12; // 转化成12小时制 calculateDegree(h, m, s); } return 0; }
标签:tput -- back else turn main height gre title
原文地址:http://www.cnblogs.com/theskulls/p/6189304.html