
3条回答 默认 最新
LYSnowy 2022-01-30 15:06关注#include <iostream> #include <cmath> using namespace std; int main() { int x, y, z; double ans; cin >> x >> y >> z; if (x > 12) //x是24小时制 { x = x - 12; } ans = abs(30 * x - 5.5 * y - (1.0 * 11 / 120) * z); //取绝对值,因为分针角度可能大于时针角度 if (ans > 180) { ans = 360 - ans; //夹角取0~180 } cout << (int)ans << endl; return 0; }
本回答被题主选为最佳回答 , 对您是否有帮助呢?评论 打赏 举报解决 2无用