criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
   int A, B, H, M;
   cin >> A >> B >> H >> M;
   double pi = 3.14159265358979323846;
   double X = cos((M / 30 - H / 6) * pi)
   double Y = cos((H / 6 - M / 30) * pi)
  if(double(M / 30 - H / 6) >= 0){
   cout << double(sqrt(A ^ 2 + B ^ 2 - 2 * A * B * X)) <<endl;
  }
  else{
   cout << double(sqrt(A ^ 2 + B ^ 2 - 2 * A * B * Y)) << endl;
  }
  return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: expected ',' or ';' before 'double'
    9 |    double Y = cos((H / 6 - M / 30) * pi)
      |    ^~~~~~
a.cc:13:3: error: 'else' without a previous 'if'
   13 |   else{
      |   ^~~~
a.cc:14:52: error: 'Y' was not declared in this scope
   14 |    cout << double(sqrt(A ^ 2 + B ^ 2 - 2 * A * B * Y)) << endl;
      |                                                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
   int A , B , H , M ;
  cin >> A >> B >> H >> M ;
  float sita1 = 0;
  float sita2 =0;
  sita1 = H*0.5;
  sita2 = M*6%360;
  
  float sita = abs(sita1-sita2);
  float y  = cos(PI / 180 * sita)
  cout << pow(A*A+B*B-2*A*B*y,0.5) << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: 'PI' was not declared in this scope
   13 |   float y  = cos(PI / 180 * sita)
      |                  ^~
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			int A = scanner.nextInt();
			int B = scanner.nextInt();
			int H = scanner.nextInt();
			int M = scanner.nextInt();

			double sita = ((double)H / 6 * Math.PI - (double)M / 30 * Math.PI);
			double answer = Math.sqrt((double)(Math.pow(A, 2) + Math.pow(B, 2) - (double)((double)(2 * A * B) * Math.cos(sita))));
			System.out.print(answer < 0 ? -(double)answer : answer);
		}
	}

Compiler output:
Main.java:16: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <cstdlib>
#include <numeric>
#include <iomanip>
using namespace std;
#define MAX_N 100

template<class T> inline bool chmax(T& a, T b) { if(a < b) {a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if(a > b) {a = b; return true; } return false; }
const long long INF = 1LL << 60;

// Input
int A,B,H,M;

int main() {
  cin >> A >> B >> H >> M;
  double theta_M = 360 * M / 60;
  double theta_H = 360 * (double)(H+(M/60.0)) / 12;

  double theta = abs(theta_H - theta_M);
  theta = theta / 360 * 2*M_PI;
  
  double C = A*A + B*B - 2*A*B*cos(theta);
  cout << fixed << setprecision(20) << sqrt(C) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: 'M_PI' was not declared in this scope
   23 |   theta = theta / 360 * 2*M_PI;
      |                           ^~~~
a.cc:25:32: error: 'cos' was not declared in this scope
   25 |   double C = A*A + B*B - 2*A*B*cos(theta);
      |                                ^~~
a.cc:26:40: error: 'sqrt' was not declared in this scope
   26 |   cout << fixed << setprecision(20) << sqrt(C) << endl;
      |                                        ^~~~
Language: C++

#include <iostream>
#include <math.h>
#include <iomanip>

using namespace std;

const long double eps = 1.0e-15;

long double mysqrt(long double x)
{
  long double a = sqrt((double)x);
  do {
    a = (a + x/a) / 2.0L;
  } while (fabsl(x - a*a) > eps);
  return a;
}

int main(void) {
    long double A, B, H, M;
    cin >> A >> B >> H >> M;
    const long double PI = 3.141592653589793238462643383279502884197169399375105820$

    cout << setprecision(15) << PI << endl;
    cout << setprecision(15) <<  mysqrt(A*A + B*B -2*A*B*cos(M_PI * 11 * (60 * H + $
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:28: error: unable to find numeric literal operator 'operator""$'
   21 |     const long double PI = 3.141592653589793238462643383279502884197169399375105820$
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:24:84: error: '$' was not declared in this scope
   24 |     cout << setprecision(15) <<  mysqrt(A*A + B*B -2*A*B*cos(M_PI * 11 * (60 * H + $
      |                                                                                    ^
a.cc:24:85: error: expected ')' before 'return'
   24 |     cout << setprecision(15) <<  mysqrt(A*A + B*B -2*A*B*cos(M_PI * 11 * (60 * H + $
      |                                                                          ~          ^
      |                                                                                     )
   25 |     return 0;
      |     ~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  cout << sqrt(A*A + B*B - 2*A*B*cos(asin(-1) * (5 * H - M) / 30) << endl;
               }


Compiler output:
a.cc: In function 'int main()':
a.cc:7:67: error: invalid operands of types 'double' and '<unresolved overloaded function type>' to binary 'operator<<'
    7 |   cout << sqrt(A*A + B*B - 2*A*B*cos(asin(-1) * (5 * H - M) / 30) << endl;
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Language: C

#include <stdio.h>
#include <math.h>

int main(void) {
	int x, y, a, b;
	scanf("%d%d%d%d", &x, &y, &a, &b);
	double t, g, r, f;
	double s;
	t = x*sin(30.5*a);
	g = x*cos(30.5*a);
	r = y*sin(6*b);
	f = y*cos(6*b);-s
	s = sqrtf(pow(t-r,2) + pow(g-f,2));
	if(s < 0){
		s = -s;
	}
	printf("%f", s);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:26: error: expected ';' before 's'
   12 |         f = y*cos(6*b);-s
      |                          ^
      |                          ;
   13 |         s = sqrtf(pow(t-r,2) + pow(g-f,2));
      |         ~
Language: C++

#include <bits/stdc++.h>
#include<cmath>
#include<math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _USE_MATH_DEFINES


int main() {
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  
  double pi =3.14159265359;
  
  double C;
  C = 2*pi/12;
  double D;
  D = 2*pi/60;
    
  double S;
  S=(A*A+B*B-2*A*B*cos((H*C+M*D/12)-M*D));
  
  cout << long double sqrtl(long double S) <<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: expected primary-expression before 'long'
   23 |   cout << long double sqrtl(long double S) <<endl;
      |           ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using lint = long long;

const long double pi = acos(-1.0);
signed main(){
	long double a, b, h, m; cin >> a >> b >> h >> m;
	long double c1 = 360 * h / 12 + 30 * m / 60, c2 = 6 * m;
	long double c = abs(c1 - c2);
	if(c > 180) c -= long double(180);
	double ans = a * a + b * b -  long double(2.0) * a * b * cos(c * pi / long double(180.0));
	cout << setprecision(10) << sqrt(ans) << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: expected primary-expression before 'long'
   10 |         if(c > 180) c -= long double(180);
      |                          ^~~~
a.cc:11:39: error: expected primary-expression before 'long'
   11 |         double ans = a * a + b * b -  long double(2.0) * a * b * cos(c * pi / long double(180.0));
      |                                       ^~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
#include<math.h>
#define PI 3.141592653589793
 
int main() {
  int a,b,h,m;
  cin >>a>>b>>h>>m;
  double r,r_a,r_b,d;
  r_b=(360*m)/60;
  r_a=(360*(60*h+m))/12*60;
  r=r_a - r_b;
  r=r*PI/180;
  d=sqrt(a*a+b*b-2*a*b*cos(r));
  cout<<d;

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

int long main () {
  double A, B, H, M, a, b, p;
  double cos(double x);
  cin >> A >> B >> H >> M;
  p==3.1415926535;
  a==p*H/6;
  b==p*M/30;
   cout << pow(A*A+B*B-2*A*B*cos(a-b),1/2) << endl;
}
  

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | int long main () {
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    int A,B,H,M,s;
    cin>>A>>B>>H>>M;
    double n;
    H=H*30;
    M=M*6;
    if(H>M){
        s=H-M;
    }else
    {
        s=M-H;
    }
    if(s>180){
        s=s-180;
    }else
    {
        s=s;
    }
    n=sqrt(A^2+B^2-2*A*B*cos(s));
    cout<<setprecision(21)<<n<<endl;
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: invalid operands of types 'int' and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'} to binary 'operator^'
   22 |     n=sqrt(A^2+B^2-2*A*B*cos(s));
      |            ~~~~~^~~~~~~~~~~~~~~
      |             |     |
      |             int   __gnu_cxx::__enable_if<true, double>::__type {aka double}
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  cout << sqrt(A*A + B*B -2*A*B*cos(asin(-1) * (5 * H - M) / 30) << endl;
               }


Compiler output:
a.cc: In function 'int main()':
a.cc:7:66: error: invalid operands of types 'double' and '<unresolved overloaded function type>' to binary 'operator<<'
    7 |   cout << sqrt(A*A + B*B -2*A*B*cos(asin(-1) * (5 * H - M) / 30) << endl;
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Language: C++

#include<vector>
#include<cmath>
#include <math.h>
using namespace std;

int main() {
	double hl, ml, h, m;
	double ans;
	double angm, angh;
	double delta;
	cin >> hl >> ml >> h >> m;
	angm = m * 6;
	angh = h * 30;
	delta = abs(angm - angh);
	ans = pow(hl, 2) + pow(ml, 2) - 2 * ml * hl * cos(delta * M_PI / 180);
	cout << pow(ans,0.5);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'cin' was not declared in this scope
   11 |         cin >> hl >> ml >> h >> m;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <math.h>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << pow(ans,0.5);
      |         ^~~~
a.cc:16:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

#include<stdio.h>
#include<math.h>
int main()
{               
        int a,b,h,m;
        scanf("%d %d %d %d",&a,&b,&h,&m);
        int k1=2*3.14*m;
        int k2;
        int d=radians(fabs(((11*m)/2)-(30*h)));
        int calc=(a**2+b**2-2*a*b*cos(d));
        int final=sqrt(calc);
        printf("%.9f",final);
}  

Compiler output:
main.c: In function 'main':
main.c:9:15: error: implicit declaration of function 'radians' [-Wimplicit-function-declaration]
    9 |         int d=radians(fabs(((11*m)/2)-(30*h)));
      |               ^~~~~~~
main.c:10:21: error: invalid type argument of unary '*' (have 'int')
   10 |         int calc=(a**2+b**2-2*a*b*cos(d));
      |                     ^~
main.c:10:26: error: invalid type argument of unary '*' (have 'int')
   10 |         int calc=(a**2+b**2-2*a*b*cos(d));
      |                          ^~
Language: C

#include<bits/stdc++.h>
using namespace std;
#include<math.h>
#define PI 3.141592653589793
 
int main() {
  int a,b,h,m;
  cin >>a>>b>>h>>m;
  double r,r_a,r_b,d;
  r_b=(360*m)/60;
  r_a=(360*(60*h+m))/12*60;
  r=r_a - r_b;
  r=r*PI/180;
  d=sqrt(a*a+b*b-2*a*b*cos(r));
  cout<<d;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  cout << sqrt(A*A + B*B -2*A*B*cos(math_pi * (5 * H - M) / 30) << endl;
               }


Compiler output:
a.cc: In function 'int main()':
a.cc:7:37: error: 'math_pi' was not declared in this scope
    7 |   cout << sqrt(A*A + B*B -2*A*B*cos(math_pi * (5 * H - M) / 30) << endl;
      |                                     ^~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void)
{
  int a,b,h,m;
  double lhand,shand,x,y,ans;

  scanf("%d %d %d %d",&a,&b,&h,&m);

  lhand = m*M_PI/30;
  shand = (60*h+m)*M_PI/360;

  x = a*sin(lhand)-b*sin(shand);
  y = a*cos(lhand)-b*cos(shand);
  
  ans = sqrt(x*x+y*y);

  printf("%.20lf\n",answer);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:21: error: 'answer' undeclared (first use in this function)
   20 |   printf("%.20lf\n",answer);
      |                     ^~~~~~
main.c:20:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
#include<cmath>
#include<math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _USE_MATH_DEFINES


int main() {
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  
  double pi =3.14159265359;
  
  double C;
  C = 2*pi/12;
  double D;
  D = 2*pi/60;
    
  double S;
  S=(A*A+B*B-2*A*B*cos((H*C+M*D/12)-M*D));
  
  double T;
  T = double sqrt(double S);
  
  cout << T <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: expected primary-expression before 'double'
   24 |   T = double sqrt(double S);
      |       ^~~~~~
Language: Java

package abc168_c;
public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int A, B, H, M;

		A = Integer.parseInt(in.next());
		B = Integer.parseInt(in.next());
		H = Integer.parseInt(in.next());
		M = Integer.parseInt(in.next());

		float alpha = 360 * H / 12 + 360 * M / 720;
		float beta = 360 * M / 60;
		float theta = Math.min(Math.abs(alpha - beta), 360-Math.abs(alpha - beta));

		double ans = Math.sqrt(Math.pow(A, 2) + Math.pow(B, 2) - 2 * A * B * Math.cos(Math.toRadians(theta)));
		System.out.println(ans);
	}
}


Compiler output:
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  double A,B;cin >> A>>B;
  int H,M;cin >>H>>M;
  cout << fixed <<steprecision(9);
  double kakudo = abs(M/30-H/6)*M_PI;
  double l=sqrt(A*A+B*B-2*A*B*cos(kakudo));
  cout << l << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: 'steprecision' was not declared in this scope
    7 |   cout << fixed <<steprecision(9);
      |                   ^~~~~~~~~~~~
Language: C

#include<string.h>
#include<math.h>
int main()
{               
        int a,b,h,m;
        scanf("%d %d %d %d",&a,&b,&h,&m);
        int k1=2*3.14*m;
        int k2;
        int d=radians(fabs(((11*m)/2)-(30*h)));
        int calc=(a**2+b**2-2*a*b*cos(d));
        int final=sqrt(calc);
        printf("%.9f",final);
}  

Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |         scanf("%d %d %d %d",&a,&b,&h,&m);
      |         ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include<math.h>
  +++ |+#include <stdio.h>
    3 | int main()
main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d %d %d %d",&a,&b,&h,&m);
      |         ^~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:9:15: error: implicit declaration of function 'radians' [-Wimplicit-function-declaration]
    9 |         int d=radians(fabs(((11*m)/2)-(30*h)));
      |               ^~~~~~~
main.c:10:21: error: invalid type argument of unary '*' (have 'int')
   10 |         int calc=(a**2+b**2-2*a*b*cos(d));
      |                     ^~
main.c:10:26: error: invalid type argument of unary '*' (have 'int')
   10 |         int calc=(a**2+b**2-2*a*b*cos(d));
      |                          ^~
main.c:12:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   12 |         printf("%.9f",final);
      |         ^~~~~~
main.c:12:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:12:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
double calAngle(double H,double M){
  //てっぺんを0度として
  double angle;
  double angleH = H * (360/12);
  double angleM = M * (360*60);
  
  double diff = abs(angleH-angleM);
  
  if(diff > 180){
	angle = diff - 180;  
  }else{
  	angle = diff;
  }
  return angle;
}

int main(){
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  
  int angle = calAngle(H,M);
  
  return pow(A,2.0) + pow(B,2.0) + 2 * A * B * cos(angle)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:58: error: expected ';' before '}' token
   26 |   return pow(A,2.0) + pow(B,2.0) + 2 * A * B * cos(angle)
      |                                                          ^
      |                                                          ;
   27 | }
      | ~
Language: C++


#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	long double a, b, h, m;
	cin >> a >> b >> h >> m;


	long double kat = abs((30 * h) - (6 * m));

	

	if (kat > 180.0) {
		kat = 360.0 - kat;
	}

	//cout << kat << '\n';

	long double rd = kat * 3.14159265 / 180.0;
	long double w = a * a + b * b - (2.0 * a * b * cos(rd));

	cout <<	sqrt(w);
	


	
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:31:18: error: expected '}' at end of input
   31 |         return 0;
      |                  ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

#include <iostream>
#include<bits/stdc++.h>
#define lli long long
#define fin  freopen("input.txt","r",stdin);
#define fout freopen("output.txt","w",stdout);
#define ini(a) scanf("%d",&a);
#define ini2(a,b) scanf("%d%d",&a,&b);
#define inl(a) scanf("%lld",&a);
#define inl2(a,b) scanf("%lld%lld",&a,&b);
#define all(a) a.begin(),a.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define SIZE 200010
#define PI 3.14159265358979
using namespace std;


int main()
{

   double a,b,c,d;
   cin>>a>>b>>c>>d;

   double dega=c*30+((d/60)*30);
   double degb=d*6;
   double kon=abs(dega-degb);
   //if(kon>=180)kon-=180;
  // cout <<kon<<endl;
   double ans=a*a+b*b-2.00*a*b*cos((kon*PI)/180.00);
   printf("%.9
          f",sqrt(ans));
}



Compiler output:
a.cc:29:11: warning: missing terminating " character
   29 |    printf("%.9
      |           ^
a.cc:29:11: error: missing terminating " character
   29 |    printf("%.9
      |           ^~~~
a.cc:30:12: warning: missing terminating " character
   30 |           f",sqrt(ans));
      |            ^
a.cc:30:12: error: missing terminating " character
   30 |           f",sqrt(ans));
      |            ^~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:30:11: error: 'f' was not declared in this scope
   30 |           f",sqrt(ans));
      |           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
namespace mp = boost::multiprecision;
// 仮数部 500 bit の浮動小数点数
using cpp_dec_float = mp::number<mp::cpp_dec_float<500>>;
typedef long long ll;

int main(void)
{
    int a, b, h, m;
    cin >> a >> b >> h >> m;
    
    // compute
    // 時間から角度を求める
    long double hh = 30 * (h % 12) + 0.5 * m;  
    long double mm = 6 * m;
    long double kakudo = abs(hh-mm);
    if (kakudo > 180) kakudo -= 180;
    else if (kakudo == 180) {
        cout << 0 << endl;
        return (0);
    }
    kakudo /= 180;
    //debug
    //cout << hh << " " << mm << endl;
    //cout << kakudo << endl;

    // output
    static const double pi = 3.141592653589793;
    long double coskakudo = cos(pi * kakudo);
    // debug
    //cout << coskakudo << endl;

    cout << fixed;
    cout << sqrt(a*a + b*b - 2*a*b*coskakudo) << endl;

}


Compiler output:
a.cc:4:16: error: 'boost' has not been declared
    4 | namespace mp = boost::multiprecision;
      |                ^~~~~
a.cc:4:23: error: 'multiprecision' is not a namespace-name
    4 | namespace mp = boost::multiprecision;
      |                       ^~~~~~~~~~~~~~
a.cc:6:23: error: 'mp' does not name a type
    6 | using cpp_dec_float = mp::number<mp::cpp_dec_float<500>>;
      |                       ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
double calAngle(H,M){
  //てっぺんを0度として
  double angle;
  double angleH = H * (360/12);
  double angleM = M * (360*60);
  
  double diff = abs(angleH-angleM);
  
  if(diff > 180){
	angle = diff - 180;  
  }else{
  	angle = diff;
  }
  return angle;
}

int main(){
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  
  int angle = calAngle(H,M);
  
  return pow(A,2.0) + pow(B,2.0) + 2 * A * B * cos(angle)
}

Compiler output:
a.cc:4:17: error: 'H' was not declared in this scope
    4 | double calAngle(H,M){
      |                 ^
a.cc:4:19: error: 'M' was not declared in this scope
    4 | double calAngle(H,M){
      |                   ^
a.cc:4:20: error: expression list treated as compound expression in initializer [-fpermissive]
    4 | double calAngle(H,M){
      |                    ^
a.cc: In function 'int main()':
a.cc:24:23: error: 'calAngle' cannot be used as a function
   24 |   int angle = calAngle(H,M);
      |               ~~~~~~~~^~~~~
a.cc:26:58: error: expected ';' before '}' token
   26 |   return pow(A,2.0) + pow(B,2.0) + 2 * A * B * cos(angle)
      |                                                          ^
      |                                                          ;
   27 | }
      | ~
Language: C++

#include <bits/stdc++.h>
#include<cmath>
#include<math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _USE_MATH_DEFINES


int main() {
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  
  double C;
  C = 2*M_PI/12;
  double D;
  D = 2*M_PI/60;
    
  double S;
  S=(A*A+B*B-2*A*B*cos((H*C+M*D/12)-M*D));
  
  double T;
  T = double sqrt(double S);
  
  cout << T <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: expected primary-expression before 'double'
   22 |   T = double sqrt(double S);
      |       ^~~~~~
Language: C++

#include<iostream>
#include<stdio.h>

using namespace std;

int main() {
	double a, b, h, m;
	cin >> a >> b >> h >> m;

	double hx = h * 30.0+0.5*m;
	double mx = m * 6.0;
	double theta;
	if (hx > mx) {
		theta = hx - mx;
	}
	else theta = mx - hx;
	
	if (theta > 180.0) {
		theta = theta - 180.0;
	}
	cout << theta << endl;
	double pi = 3.14159265359;

	double x = (a * a) +( b * b) - (2.0 * a * b * cos(theta * (pi/180.0)));
	printf("%.9f", sqrt(x)); 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:55: error: 'cos' was not declared in this scope
   24 |         double x = (a * a) +( b * b) - (2.0 * a * b * cos(theta * (pi/180.0)));
      |                                                       ^~~
a.cc:25:24: error: 'sqrt' was not declared in this scope
   25 |         printf("%.9f", sqrt(x));
      |                        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  cout << sqrt(A**2 + B**2 -2*A*B*cos(math.pi * (5 * H - M) / 30) << endl;
               }


Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: invalid type argument of unary '*' (have 'int')
    7 |   cout << sqrt(A**2 + B**2 -2*A*B*cos(math.pi * (5 * H - M) / 30) << endl;
      |                  ^~
a.cc:7:25: error: invalid type argument of unary '*' (have 'int')
    7 |   cout << sqrt(A**2 + B**2 -2*A*B*cos(math.pi * (5 * H - M) / 30) << endl;
      |                         ^~
a.cc:7:39: error: 'math' was not declared in this scope
    7 |   cout << sqrt(A**2 + B**2 -2*A*B*cos(math.pi * (5 * H - M) / 30) << endl;
      |                                       ^~~~
Language: Java

import java.util.Scanner;

// https://atcoder.jp/contests/abc168/tasks/abc168_c
public class　Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		double a = sc.nextDouble();
		double b = sc.nextDouble();
		double h = sc.nextDouble();
		double m = sc.nextDouble();
		sc.close();


		double aw = h*30.0  +  m * 0.5;
		double bw = m * 6.0;

		double w = aw - bw;
		double cos = Math.cos(Math.toRadians(w));
		if(Math.abs(cos)>Math.pow(1.0, -17)) {
			cos = 0.0;
		}

		double ans = a*a + b*b - 2.0*a*b*cos;
		System.out.println(Math.sqrt(ans));

	}
}


Compiler output:
Main.java:4: error: illegal character: '\u3000'
public class?Main {
            ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int a,b;
  cin >> a >> b;
  int h,w;
  cin >> h >> w;
  double l,s;
  l=(h*30+w*0.5);
  s=w*6;
  
  double p=max(l-s,s-l);
  
  if(p!=180){
    p%=180;
    p*=M_PI; 
    double ans=ans=a*a+b*b-2*a*b*cos(p);
    printf("%.25f\n",sqrt(ans));
  }
  
  else{
    cout << a+b << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   16 |     p%=180;
      |     ~^~~~~
a.cc:16:6: note:   in evaluation of 'operator%=(double, int)'
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

// use M_PI

int main(void) {
    
    long A,B,H,M;
    scanf("%ld %ld %ld %ld",&A,&B,&H,&M);

    // jishin
    long double Arad = ((H*30.0) + (M/2.0)) * M_PI/180.0;
    long double Brad = M * 6.0 * M_PI/180.0;

    long double res = sqrtl(((A * sin(Arad) - B * sin(Brad)) *  (A * sin(Arad) - B * sin(Brad))) + ((A * cos(Arad) - B * cos(Brad)) * (A * cos(Arad) - B * cos(Brad))));
    printf("%.70Lf\n",res);

    return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccoVZ1x8.o: in function `main':
main.c:(.text+0xe5): undefined reference to `sin'
/usr/bin/ld: main.c:(.text+0x111): undefined reference to `sin'
/usr/bin/ld: main.c:(.text+0x146): undefined reference to `sin'
/usr/bin/ld: main.c:(.text+0x172): undefined reference to `sin'
/usr/bin/ld: main.c:(.text+0x1b0): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x1dc): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x211): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x23d): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x272): undefined reference to `sqrtl'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#include<cmath>
#include<math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _USE_MATH_DEFINES


int main() {
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  
  int C;
  C = 2*M_PI/12;
  int D;
  D = 2*M_PI/60;
    
  double S;
  S=(A*A+B*B-2*A*B*cos((H*C+M*D/12)-M*D));
  
  double T;
  T = double sqrt(double S);
  
  cout << T <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: expected primary-expression before 'double'
   22 |   T = double sqrt(double S);
      |       ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  cout << sqrt(A ** 2 + B ** 2 -2 * A * B * cos(pi * (5 * H - M) / 30) << endl;
               }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: invalid type argument of unary '*' (have 'int')
    7 |   cout << sqrt(A ** 2 + B ** 2 -2 * A * B * cos(pi * (5 * H - M) / 30) << endl;
      |                   ^~~
a.cc:7:28: error: invalid type argument of unary '*' (have 'int')
    7 |   cout << sqrt(A ** 2 + B ** 2 -2 * A * B * cos(pi * (5 * H - M) / 30) << endl;
      |                            ^~~
a.cc:7:49: error: 'pi' was not declared in this scope
    7 |   cout << sqrt(A ** 2 + B ** 2 -2 * A * B * cos(pi * (5 * H - M) / 30) << endl;
      |                                                 ^~
Language: C++

#include<bits/stdc++.h> 
using namespace std;
double abso(double d)
{
  if(d<0)
    return -d;
  else
    return d;
}
int main()
{
  	int a,b,hour,min;
  cin>>a>>b>>hour>>min;
	double h = (hour * 360) / 12 + (min * 360) / (12 * 60);
	double m = (min * 360) / (60);
	double angle = abs0(h - m);
	if (angle > 180)
		angle = 360 - angle;

  	double c;
  	c=a*a+b*b- (2*a*b*cos(angle));
  	cout<<sqrtd(c);
  	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: 'abs0' was not declared in this scope; did you mean 'abso'?
   16 |         double angle = abs0(h - m);
      |                        ^~~~
      |                        abso
a.cc:22:15: error: 'sqrtd' was not declared in this scope; did you mean 'sqrtl'?
   22 |         cout<<sqrtd(c);
      |               ^~~~~
      |               sqrtl
Language: C++

#include <vector>
#include <iostream>
#include <string>
#include <algorithm>

#define PI 3.141592653589793

using namespace std;
int main(int argc, char* argv[])
{
	//ABC168 C
	int a, b, h, m;
	double ax, bx,ay,by;
	double ka, kb;	// 角度
	double ans;
	// A B H M
	//cin >> x >> y >> a >> b >> c;
	// A 時針の長さ B 分針の長さ H時M分 
	// cos x sin y

	cin >> a >> b >> h >> m;

	ka = (360.0 / 60.0 * m) * PI / 180.0;
	kb = ((360.0 / 12.0 * h) + (0.5 * m)) * PI / 180.0;

	ax = a * sin(ka);
	bx = b * sin(kb);
	ay = a * cos(ka);
	by = b * cos(kb);

	ans = sqrt(pow(bx - ax,2.0) + pow(by - ay,2.0));

	printf("%.16f", ans);

	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:26:18: error: 'sin' was not declared in this scope
   26 |         ax = a * sin(ka);
      |                  ^~~
a.cc:28:18: error: 'cos' was not declared in this scope
   28 |         ay = a * cos(ka);
      |                  ^~~
a.cc:31:20: error: 'pow' was not declared in this scope
   31 |         ans = sqrt(pow(bx - ax,2.0) + pow(by - ay,2.0));
      |                    ^~~
a.cc:31:15: error: 'sqrt' was not declared in this scope
   31 |         ans = sqrt(pow(bx - ax,2.0) + pow(by - ay,2.0));
      |               ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main () {
  double A, B, H, M, a, b;
  cin >> A >> B >> H >> M;
  a==pi*H/6;
  b==pi*M/30;
   cout << A*A+B*B-2*A*B*cos(a-b) << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: 'pi' was not declared in this scope
    7 |   a==pi*H/6;
      |      ^~
Language: C++

#include <bits/stdc++.h>
#include<cmath>
#include<math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _USE_MATH_DEFINES


int main() {
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  
  int C;
  C = 2*M_PI/12;
  int D;
  D = 2*M_PI/60;
    
  int S;
  S=(A*A+B*B-2*A*B*cos((H*C+M*D/12)-M*D));
  
  int T;
  T = double sqrt(double S);
  
  cout << S <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: expected primary-expression before 'double'
   22 |   T = double sqrt(double S);
      |       ^~~~~~
Language: C

#include <stdio.h>
#include <math.h>

int main()
{
  int a,b,h,m;
  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&h);
  scanf("%d",&m);

  printf("%f",(double)sqrt(hypot(a,b)-2*a*b*cos(30*h-6*m));
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:59: error: expected ')' before ';' token
   12 |   printf("%f",(double)sqrt(hypot(a,b)-2*a*b*cos(30*h-6*m));
      |         ~                                                 ^
      |                                                           )
main.c:13:12: error: expected ';' before '}' token
   13 |   return 0;
      |            ^
      |            ;
   14 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  
  double dig,ans;
  dig = abs(M_PI(H/6 - M/30));
  ans = sqrt(A*A + B*B -(2*cos(dig)));
  cout << ans << endl;  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expression cannot be used as a function
    9 |   dig = abs(M_PI(H/6 - M/30));
      |                 ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	double a, b, h, m;
	static const double PI = 3.141592653589793;
	cin >> a >> b >> h >> m;
	double aPosY = a * sin((h * PI / 6) + (PI / 12) * (m / 60));
	double aPosX = a * cos((h * PI / 6) + (PI / 12) * (m / 60));
	double bPosY = b * sin(m * PI / 30);
	double bPosX = b * cos(m * PI / 30);
	double x = (aPosX - bPosX) * (aPosX - bPosX);
	double y = (aPosY - bPosY) * (aPosY - bPosY);
	double dist = sqrt(x + y);
	cout << dist;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: 'sin' was not declared in this scope
    8 |         double aPosY = a * sin((h * PI / 6) + (PI / 12) * (m / 60));
      |                            ^~~
a.cc:9:28: error: 'cos' was not declared in this scope
    9 |         double aPosX = a * cos((h * PI / 6) + (PI / 12) * (m / 60));
      |                            ^~~
a.cc:14:23: error: 'sqrt' was not declared in this scope
   14 |         double dist = sqrt(x + y);
      |                       ^~~~
Language: C++

#include <bits/stdc++.h>
#include<cmath>
#include<math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _USE_MATH_DEFINES


int main() {
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  
  int C;
  C = 2*M_PI/12;
  int D;
  D = 2*M_PI/60;
    
  int S;
  S=(A*A+B*B-2*A*B*cos((H*C+M*D/12)-M*D));
  
  int T;
  T = long double sqrt(S);
  
  cout << S <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: expected primary-expression before 'long'
   22 |   T = long double sqrt(S);
      |       ^~~~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;

int main() {
  int A,B,H,M;
  cin>>A>>B>>hour>>minute;
  double angle1=hour*30+minute*0.25;
  double angle2=minute*6;
  double angle3=max(angle1,angle2)-min(angle1,angle2);
  double angle=min(angle3,360-angle3);
  cout<<A*A+B*B-2*A*B*cos(angle)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'hour' was not declared in this scope
    7 |   cin>>A>>B>>hour>>minute;
      |              ^~~~
a.cc:7:20: error: 'minute' was not declared in this scope; did you mean 'finite'?
    7 |   cin>>A>>B>>hour>>minute;
      |                    ^~~~~~
      |                    finite
Language: C++

#include <iostream>
#include<string>
#define M_PI 3.14159265358979
#define deg_to_rad(deg) (((deg)/360)*2*M_PI)
using namespace std;


int main() {

	int A;
	int B;
	int H;
	int M;
	cin >> A;
	cin >> B;
	cin >> H;
	cin >> M;

	//角度
	double zi;
	double hun;

	double kakudo;

	M = M + H * 60;

	zi = M * 0.5;
	hun = (M * 6) % 360;

	kakudo = zi - hun;
	kakudo = abs(kakudo);

	if (kakudo > 180) { kakudo = kakudo - 180; }

	double answer;

	answer = (A*A) + (B*B) - 2 * A*B*cos(deg_to_rad(kakudo));
	answer = sqrt(answer);
	cout << answer << endl;

	system("pause");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:42: error: 'cos' was not declared in this scope
   37 |         answer = (A*A) + (B*B) - 2 * A*B*cos(deg_to_rad(kakudo));
      |                                          ^~~
a.cc:38:18: error: 'sqrt' was not declared in this scope
   38 |         answer = sqrt(answer);
      |                  ^~~~
Language: C++

import math

A,B,H,M=(int(x) for x in input().split())
ang = (30*H - 11*M/2)*math.pi/180;
ans = math.sqrt(A*A + B*B - 2*A*B*math.cos(ang));
print(ans)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'ans' does not name a type
    5 | ans = math.sqrt(A*A + B*B - 2*A*B*math.cos(ang));
      | ^~~
a.cc:6:6: error: expected constructor, destructor, or type conversion before '(' token
    6 | print(ans)
      |      ^
Language: C++

from math import pi, cos
s=input()	.split(" ")
a=float(s[0])
b=float(s[1])
h=float(s[2])
m=float(s[3])
mm=6*m
gg=float((h*60+m)/2)
alf=abs(gg-mm)%180
if(alf>180):
	alf-=180
alf=alf*pi/180
x=a**2+b**2-2*a*b*cos(alf)
print(x**(1/2))


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from math import pi, cos
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
double a,b,h,m;
  cin>>a>>b>>h>>m;
double pi = 3.141592653589793
  cout<<fixed<<setprecision(10)<<sqrt(pow(a,2)+pow(b,2)-2*a*b*cos(min(abs(2*pi*a/60-2*pi*b/12-2*pi*b/720),2*pi-abs(2*pi*a/60-2*pi*b/12-2*pi*b/720))))<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'cout'
    7 |   cout<<fixed<<setprecision(10)<<sqrt(pow(a,2)+pow(b,2)-2*a*b*cos(min(abs(2*pi*a/60-2*pi*b/12-2*pi*b/720),2*pi-abs(2*pi*a/60-2*pi*b/12-2*pi*b/720))))<<endl;
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
template<typename T>
inline void read(T &x)
{
	x=0;
	int f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9')
	{
		if(ch=='-') f=-1;
		ch=getchar();
}
	while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=getchar();
	x*=f;
	return;
}	
template<typename T>
void write(T x)
{
	if(x<0) putchar('-'),x=-x;
	if(x>=10) write(x/10);
	putchar(x%10+'0');
	return;
}
const long double M_PI=3.14159265358979323846264338327950288;
long double a,b;
int h,m;
long double c,d;
int main()
{
    cin>>a>>b>>h>>m;
    c=2.0*M_PI*h/12.0+2.0*M_PI*m/720.0,d=2.0*M_PI*m/60.0;
    printf("%.12Lf\n",sqrt(a*a+b*b-2*a*b*cos(fabs(c-d))));
	return 0;
}


Compiler output:
In file included from /usr/include/c++/14/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114,
                 from a.cc:1:
a.cc:26:19: error: expected unqualified-id before numeric constant
   26 | const long double M_PI=3.14159265358979323846264338327950288;
      |                   ^~~~
Language: C

#include <inttypes.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

long double min(long double a, long double b)
{
    return a < b ? a : b;
}

int main(void)
{
    intmax_t A, B, H, M;
    double degree, ans = 0;

    scanf("%jd%jd%jd%jd", &A, &B, &H, &M);

    degree = fabs(0.5 * ((60 * H) + M) - 6 * M);
    degree = min(360 - degree, degree);

    ans = sqrt(A * A + B * B - 2 * A * B * cos(degree * M_PI / 180));

    printf("%.10f\n", ans);

    return 0;
}


Compiler output:
/usr/bin/ld: /tmp/cc5pfgeD.o: in function `main':
main.c:(.text+0x15b): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x178): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include <math.h>       /* sin */
using namespace std;
#define PI 3.1415926535897932384626


int min(int x, int y) {  
    return (x < y)? x: y;  
}  
 
double calcAngle(double h, double m)   {  
   
    double hour_angle = 0.5 * (h * 60 + m);  
    double minute_angle = 6 * m;  
 
    double  angle = abs(hour_angle - minute_angle);  
 
    angle = min(360.0 - angle, angle);  
 
    return angle;  
}

double calcSide(double angle, int a, int b) {
double ans = (r*r*1.0);
ans += (s*s*1.0);
ans -= (2*r*1.0*s*1.0*cos(angle*PI/180));
return sqrt(ans);
}

int main() {

int r, s, h, m;
cin>>a>>b>>h>>m;

double angle = calcAngle(1.0*h, 1.0*m);
// cout<<angle<<endl;
printf("%.12f\n", calcSide(angle, r, s));

}


Compiler output:
a.cc: In function 'double calcSide(double, int, int)':
a.cc:24:15: error: 'r' was not declared in this scope
   24 | double ans = (r*r*1.0);
      |               ^
a.cc:25:9: error: 's' was not declared in this scope
   25 | ans += (s*s*1.0);
      |         ^
a.cc: In function 'int main()':
a.cc:33:6: error: 'a' was not declared in this scope
   33 | cin>>a>>b>>h>>m;
      |      ^
a.cc:33:9: error: 'b' was not declared in this scope
   33 | cin>>a>>b>>h>>m;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef vector<int64_t> vi;
typedef vector<vector<int64_t>> vvi;
const double pi = 3.14159265358979;

int main(){
    int a,b,h,m; cin >> a >> b >> h >> m;
    double ax,ay,bx,by,rh,rm,r;
    
    
    rh = (30*h+30*m/60)*pi/180; rm = 6*m*pi/180;
    r = abs(rh-rm); r=r%pi;
    //if(r > pi) r-=pi;
    ax = a*cos(rh); ay = a*sin(rh);
    bx = b*cos(rm); by = b*sin(rm);
//    double dist = sqrt(pow(ax-bx,2)+pow(ay-by,2));
    double dist = sqrt(a*a + b*b - 2*a*b*cos(r));
    //cout << ax << " " << ay << endl;
    //cout << bx << " " << by << endl;
    cout << setprecision(15) << dist << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: invalid operands of types 'double' and 'const double' to binary 'operator%'
   13 |     r = abs(rh-rm); r=r%pi;
      |                       ~^~~
      |                       | |
      |                       | const double
      |                       double
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() { 
  int a,b,h,m;
  cin>>a>>b>>h>>m;
  long long double c,c2,x,r1,r2,pi;
  pi=3.14159265358979;
  r1=2*pi*h/12;
  r2=2*pi*m/60;
  
  if(r2<r1){
    x=r1-r2;
    }
  else{
    x=r2-r1;
    }
  c2=a*a+b*b-2*a*b*cos(x);
  c=sqrt(c2);
  cout<< c<<endl;
  return 0;
  }
  
  



Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: 'long long' specified with 'double'
    6 |   long long double c,c2,x,r1,r2,pi;
      |        ^~~~
a.cc:6:8: error: 'long long' specified with 'double'
a.cc:6:8: error: 'long long' specified with 'double'
a.cc:6:8: error: 'long long' specified with 'double'
a.cc:6:8: error: 'long long' specified with 'double'
a.cc:6:8: error: 'long long' specified with 'double'
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef vector<int64_t> vi;
typedef vector<vector<int64_t>> vvi;
const double pi = 3.14159265358979;

int main(){
    int a,b,h,m; cin >> a >> b >> h >> m;
    double ax,ay,bx,by,rh,rm,r;
    
    
    rh = (30*h+30*m/60)*pi/180; rm = 6*m*pi/180;
    r = abs(rh-rm); r%=pi;
    //if(r > pi) r-=pi;
    ax = a*cos(rh); ay = a*sin(rh);
    bx = b*cos(rm); by = b*sin(rm);
//    double dist = sqrt(pow(ax-bx,2)+pow(ay-by,2));
    double dist = sqrt(a*a + b*b - 2*a*b*cos(r));
    //cout << ax << " " << ay << endl;
    //cout << bx << " " << by << endl;
    cout << setprecision(15) << dist << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   13 |     r = abs(rh-rm); r%=pi;
      |                     ~^~~~
a.cc:13:22: note:   in evaluation of 'operator%=(double, double)'
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

// use M_PI

int main(void) {
    
    long A,B,H,M;
    scanf("%ld %ld %ld %ld",&A,&B,&H,&M);

    // jishin
    long double Arad = ((H*30.0) + (M/2.0)) * M_PI/180.0;
    long double Brad = M * 6.0 * M_PI/180.0;

    long double res = sqrtl(((A * sin(Arad) - B * sin(Brad)) *  (A * sin(Arad) - B * sin(Brad))) + ((A * cos(Arad) - B * cos(Brad)) * (A * cos(Arad) - B * cos(Brad))));
    printf("%.10Lf\n",res);

    return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccrYz85o.o: in function `main':
main.c:(.text+0xe5): undefined reference to `sin'
/usr/bin/ld: main.c:(.text+0x111): undefined reference to `sin'
/usr/bin/ld: main.c:(.text+0x146): undefined reference to `sin'
/usr/bin/ld: main.c:(.text+0x172): undefined reference to `sin'
/usr/bin/ld: main.c:(.text+0x1b0): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x1dc): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x211): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x23d): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x272): undefined reference to `sqrtl'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#include<cmath>
#include<math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _USE_MATH_DEFINES


int main() {
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  
  int C;
  C = 2*M_PI/12;
  int D;
  D = 2*M_PI/60;
    
  int S;
  S=(A*A+B*B-2*A*B*cos((H*C+M*D/12)-M*D));
  
  cout << double sqrt(S) <<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: expected primary-expression before 'double'
   21 |   cout << double sqrt(S) <<endl;
      |           ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  double A,B,H,M;cin>>A>>B>>H>>M;
  double answer;
  double x=(30*H-5.5*M)*3.141592653589793/180.0;
  if(x==0) cout<<B-A<<endl;
  if else(x==1) cout<<A+B<<endl;
  else{
    answer=A*A+B*B-2*A*B*cos(x);
    answer=sqrt(answer);
    printf("%.9f",answer);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: expected '(' before 'else'
    8 |   if else(x==1) cout<<A+B<<endl;
      |      ^~~~
      |      (
a.cc:9:3: error: 'else' without a previous 'if'
    9 |   else{
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
using ll=long long;
#define PI 3.14159265359
int main(){
  int a,b,h,m;
  cin>>a>>b>>h>>m;
  double H,M;
  H=(h/12+m/720)*PI;
  M=(m/60)*PI;
  
  double c=cos;
  if(H>M)c=cos(H-M);
  else c=cos(M-H);
  double x=a*a+b*b-2*a*b*c;
  double ans=sqrt(x);
  printf(%.9f,ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: cannot resolve overloaded function 'cos' based on conversion to type 'double'
   13 |   double c=cos;
      |            ^~~
a.cc:18:10: error: expected primary-expression before '%' token
   18 |   printf(%.9f,ans);
      |          ^
Language: C

#include <stdio.h>
#include <math.h>

int main(void){
  int A,B,H,M;
  scanf("%d %d %d %d",&A,&B,&H,&M);
  
  double the = 30 * H - 6 * M;
  
  if(-180.0 <= the && the <= 180){
    printf("%lf",sqrt(pow((double)A,2.0) + pow(double(B),2.0) - 2 * A * B * cos(the)));
  }else{
    printf("%lf",sqrt(pow((double)A,2.0) + pow(double(B),2.0) - 2 * A * B * cos(fabs(the))));
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:48: error: expected expression before 'double'
   11 |     printf("%lf",sqrt(pow((double)A,2.0) + pow(double(B),2.0) - 2 * A * B * cos(the)));
      |                                                ^~~~~~
main.c:11:44: error: too few arguments to function 'pow'
   11 |     printf("%lf",sqrt(pow((double)A,2.0) + pow(double(B),2.0) - 2 * A * B * cos(the)));
      |                                            ^~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: declared here
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
main.c:13:48: error: expected expression before 'double'
   13 |     printf("%lf",sqrt(pow((double)A,2.0) + pow(double(B),2.0) - 2 * A * B * cos(fabs(the))));
      |                                                ^~~~~~
main.c:13:44: error: too few arguments to function 'pow'
   13 |     printf("%lf",sqrt(pow((double)A,2.0) + pow(double(B),2.0) - 2 * A * B * cos(fabs(the))));
      |                                            ^~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: declared here
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#define mod 1000007
using namespace std;                       
typedef long long ll;

 int main(){
 	double  n,m,k,l,t1,t2,t3,t4,t5;
	   scanf("%lf%lf%lf%lf",&n,&m,&k,&l);
	        t1=30*k+l*30/60;
	        t2=l*6;
	        t3=fabs(t2-t1);
	        t4=t3*3.1415926535897932384626433/180;
	        t5=sqrt(n*n+m*m-2*n*m*cos(t4));
	        printf("%.12f",t5)
	    }

Compiler output:
a.cc: In function 'int main()':
a.cc:23:35: error: expected ';' before '}' token
   23 |                 printf("%.12f",t5)
      |                                   ^
      |                                   ;
   24 |             }
      |             ~