昨晚做这个时钟的题,真的是,做的我吐了,忘了考虑几小时几分钟的时候,不是对应在整数点的,而是有偏差的
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <bits/stdc++.h> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> Pl;
typedef pair<int, int> P;
#include <cmath>
int main()
{
double A, B, H, M, ans, tmp, ang1, ang2;
cin >> A >> B >> H >> M;
ang1 = 6.0 * M;
ang2 = 30.0 * H + 0.5 * M;
tmp = (A * A) + (B * B) - (2 * A * B) * cos(abs(ang1 - ang2) * M_PI / 180);
ans = sqrt(tmp);
cout << fixed;
cout << setprecision(20) << ans << endl;
return 0;
}