Language: C++

#include <bits/stdc++.h>
typedef long long ll;

#define F first 
#define S second 
#define PB push_back 
#define MP make_pair

int A, B, H, M;

int main() {
    cin >> A >> B >> H >> M;
    double mdeg = M * 6;
    double hdeg = H * 30 + (mdeg / 12.0);
    double degc = abs(hdeg - mdeg);
    degc *= (M_PI / 180.0);

    // c2 = a2 + b2 − 2ab cos(C)
    double csqr = (A*A) + (B*B) - (2*A*B*cos(degc));

    cout << fixed << showpoint;
    cout << setprecision(20);
    cout << sqrt(csqr) << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |     cin >> A >> B >> H >> M;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:21:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |     cout << fixed << showpoint;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:21:13: error: 'fixed' was not declared in this scope
   21 |     cout << fixed << showpoint;
      |             ^~~~~
a.cc:21:13: note: suggested alternatives:
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/ios_base.h:1104:3: note:   'std::fixed'
 1104 |   fixed(ios_base& __base)
      |   ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:198:
/usr/include/c++/14/charconv:622:21: note:   'std::chars_format::fixed'
  622 |     scientific = 1, fixed = 2, hex = 4, general = fixed | scientific
      |                     ^~~~~
a.cc:21:22: error: 'showpoint' was not declared in this scope; did you mean 'std::showpoint'?
   21 |     cout << fixed << showpoint;
      |                      ^~~~~~~~~
      |                      std::showpoint
/usr/include/c++/14/bits/ios_base.h:973:3: note: 'std::showpoint' declared here
  973 |   showpoint(ios_base& __base)
      |   ^~~~~~~~~
a.cc:22:13: error: 'setprecision' was not declared in this scope; did you mean 'std::setprecision'?
   22 |     cout << setprecision(20);
      |             ^~~~~~~~~~~~
      |             std::setprecision
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:202:3: note: 'std::setprecision' declared here
  202 |   setprecision(int __n)
      |   ^~~~~~~~~~~~
a.cc:23:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |     cout << sqrt(csqr) << endl;
      |                           ^~~~
      |                           std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~