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

/*
2020-05-05
atcoder ABC
*/

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define EPS (1e-7)
#define INF (1e9)
#define PI 3.14159265358979323846264338327950L

const ll mod = 1000000007;

int reduce(double p, double q){
    while(p >= q){
        p -= q;
    }
    return p;
}

int main() {
    int A, B, H, M, T;
    long double e;
    cin >> A >> B >> H >> M;

    T = M + 60 * H;
    e = reduce(double(T * 5.5), 360.0);
    e = min(e, double(360 - e));
    cout << fixed << setprecision(20) << sqrt(pow(A, 2.0) + pow(B, 2.0) - 2 * A * B * cos(double(PI * e / 180))) << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:12: error: no matching function for call to 'min(long double&, double)'
   34 |     e = min(e, double(360 - e));
      |         ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:34:12: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
   34 |     e = min(e, double(360 - e));
      |         ~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:34:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   34 |     e = min(e, double(360 - e));
      |         ~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(void){
  	long double PI=3.1415926535897932;
  	long double A,B,H,M;
  	scanf("%llf%llf%llf%llf",&A,&B,&H,&M);
  	long double XA,YA,XB,YB;
  	
  	long double Arad = PI*5/2-H*2*M_PI/12-M*2*M_PI/720;
  	long double Brad = PI*5/2-M*2*M_PI/60;
  	long double eps = 100;
  	XA = A*cos(Arad);
  	YA = A*sin(Arad);
  	XB = B*cos(Brad);
  	YB = B*sin(Brad);
	long double x_dis = XA-XB;
	long double y_dis = YA-YB; 
  	long double xhoge = x_dis*x_dis;
  	long double yhoge = y_dis*y_dis;
  	long double ans = sqrt(xhoge+yhoge)*eps;

  long double ans2 =ans *eps*eps*eps;
	int ans3 = (int)ans2%100;
  
printf("%llf",ans/eps);
      	printf("%d",ans3);
  	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf' was not declared in this scope
    9 |         scanf("%llf%llf%llf%llf",&A,&B,&H,&M);
      |         ^~~~~
a.cc:28:1: error: 'printf' was not declared in this scope
   28 | printf("%llf",ans/eps);
      | ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include <float.h>
  +++ |+#include <cstdio>
    4 | using namespace std;
Language: C

    #include <stdio.h>
    #include <math.h>
     
    int main(){
       int  a,b,h,m;
       double ra,rb;
     
       scanf("%d %d %d %d",&a,&b,&h,&m);
       ra=(h*60.0+m)/2;
       rb=m*6;
       if (ra>rb) ra-=rb;
       else       ra=rb-ra;
       if (ra>180) ra=360-ra;
       if (ra>90)
          printf("%f\n",sqrt(a*a+b*b+2.0*a*b*cos((180-ra)*3.14159927/180)));
       else
          printf("%f\n",sqrt(a*a+b*b-2.0*a*b*cos(ra*3.14159927/180)));
       return 0;
    }

#include <stdio.h>
#include <math.h>
#define PI 3.14159265359

int main(){
   int  a,b,h,m;
   double ra,rb;

   scanf("%d %d %d %d",&a,&b,&h,&m);
   ra=(h*60.0+m)/2;
   rb=m*6;
   if (ra>rb) ra-=rb;
   else       ra=rb-ra;
   if (ra>180) ra=360-ra;
   if (ra>90)
      printf("%f\n",sqrt(a*a+b*b+2.0*a*b*cos((180-ra)*PI/180)));
   else
      printf("%f\n",sqrt(a*a+b*b-2.0*a*b*cos(ra*PI/180)));
   return 0;
}

Compiler output:
main.c:25:5: error: redefinition of 'main'
   25 | int main(){
      |     ^~~~
main.c:4:9: note: previous definition of 'main' with type 'int()'
    4 |     int main(){
      |         ^~~~
Language: Java

import java.util.Scanner;
import java.lang.Math;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
			int A = sc.nextInt();
      		int B = sc.nextInt();
      		int H = sc.nextInt();
      		int M = sc.nextInt();
      		float rad = Math.abs(H*30+M*0.5 - M*6);
      		if(rad >= 180){
            rad = 360 - rad;
            }
      		double C = 0;
      		
      		C  =  Math.pow(A,2)+Math.pow(B,2) - 2*A*B*Math.cos(Math.toRadians(rad));
      
		System.out.println(Math.pow(C,0.5));
	}
 
}

Compiler output:
Main.java:12: error: incompatible types: possible lossy conversion from double to float
      		float rad = Math.abs(H*30+M*0.5 - M*6);
      		                    ^
1 error
Language: C++

#define vi vector<int>
#define vvi vector<vector<int>>
#define all(a) (a).begin(), (a).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int MOD = 1e9+7;
const ll LINF = 1e18;
const int INF = 1e9;
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
 
const double unit_m = 6;
const double unit_h = 0.5;
const double pi = 3.14159265358979;
int main()
{
    cin >> A >> B >> H >> M;
 
    double diff = abs((double)(H*60+M)*unit_h-(double)M*unit_m);
    if(diff > 180.) diff-=180.;
 
 
    double length_ji = A*A + B*B -(2*A*B*cos(pi*(diff/180.)));
    printf("%.9lf",sqrt(length_ji));
 
    
    return 0;
}

Compiler output:
a.cc:7:7: error: 'll' does not name a type; did you mean 'all'?
    7 | const ll LINF = 1e18;
      |       ^~
      |       all
a.cc:9:1: error: 'll' does not name a type; did you mean 'all'?
    9 | ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
      | ^~
      | all
a.cc:10:1: error: 'string' does not name a type
   10 | string S, T;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:17:5: error: 'cin' was not declared in this scope
   17 |     cin >> A >> B >> H >> M;
      |     ^~~
a.cc:17:12: error: 'A' was not declared in this scope
   17 |     cin >> A >> B >> H >> M;
      |            ^
a.cc:17:17: error: 'B' was not declared in this scope
   17 |     cin >> A >> B >> H >> M;
      |                 ^
a.cc:17:22: error: 'H' was not declared in this scope
   17 |     cin >> A >> B >> H >> M;
      |                      ^
a.cc:17:27: error: 'M' was not declared in this scope
   17 |     cin >> A >> B >> H >> M;
      |                           ^
a.cc:19:19: error: 'abs' was not declared in this scope
   19 |     double diff = abs((double)(H*60+M)*unit_h-(double)M*unit_m);
      |                   ^~~
a.cc:23:42: error: 'cos' was not declared in this scope; did you mean 'const'?
   23 |     double length_ji = A*A + B*B -(2*A*B*cos(pi*(diff/180.)));
      |                                          ^~~
      |                                          const
a.cc:24:20: error: 'sqrt' was not declared in this scope
   24 |     printf("%.9lf",sqrt(length_ji));
      |                    ^~~~
a.cc:24:5: error: 'printf' was not declared in this scope
   24 |     printf("%.9lf",sqrt(length_ji));
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #define vi vector<int>
Language: Java

import java.util.Scanner;
import java.lang.Math;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
			int A = sc.nextInt();
      		int B = sc.nextInt();
      		int H = sc.nextInt();
      		int M = sc.nextInt();
      		float rad = Math.abs(H*30+0.5M - M*6);
      		if(rad >= 180){
            rad = 360 - rad;
            }
      		double C = 0;
      		
      		C  =  Math.pow(A,2)+Math.pow(B,2) - 2*A*B*Math.cos(Math.toRadians(rad));
      
		System.out.println(Math.pow(C,0.5));
	}
 
}

Compiler output:
Main.java:12: error: ')' or ',' expected
      		float rad = Math.abs(H*30+0.5M - M*6);
      		                             ^
Main.java:12: error: not a statement
      		float rad = Math.abs(H*30+0.5M - M*6);
      		                               ^
Main.java:12: error: ';' expected
      		float rad = Math.abs(H*30+0.5M - M*6);
      		                                    ^
3 errors
Language: C++

#define vi vector<int>
#define vvi vector<vector<int>>
#define all(a) (a).begin(), (a).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int MOD = 1e9+7;
const ll LINF = 1e18;
const int INF = 1e9;
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
 
const double unit_m = 6;
const double unit_h = 0.5;
const double pi = 3.14159265358979;
int main()
{
    cin >> A >> B >> H >> M;
 
    double diff = abs((double)(H*60+M)*unit_h-(double)M*unit_m);
    if(diff > 180.) diff-=180.;
 
 
    double length_ji = A*A + B*B -(2*A*B*cos(pi*(diff/180.)));
    printf("%.9f",sqrt(length_ji));
 
    
    return 0;
}

Compiler output:
a.cc:7:7: error: 'll' does not name a type; did you mean 'all'?
    7 | const ll LINF = 1e18;
      |       ^~
      |       all
a.cc:9:1: error: 'll' does not name a type; did you mean 'all'?
    9 | ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
      | ^~
      | all
a.cc:10:1: error: 'string' does not name a type
   10 | string S, T;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:17:5: error: 'cin' was not declared in this scope
   17 |     cin >> A >> B >> H >> M;
      |     ^~~
a.cc:17:12: error: 'A' was not declared in this scope
   17 |     cin >> A >> B >> H >> M;
      |            ^
a.cc:17:17: error: 'B' was not declared in this scope
   17 |     cin >> A >> B >> H >> M;
      |                 ^
a.cc:17:22: error: 'H' was not declared in this scope
   17 |     cin >> A >> B >> H >> M;
      |                      ^
a.cc:17:27: error: 'M' was not declared in this scope
   17 |     cin >> A >> B >> H >> M;
      |                           ^
a.cc:19:19: error: 'abs' was not declared in this scope
   19 |     double diff = abs((double)(H*60+M)*unit_h-(double)M*unit_m);
      |                   ^~~
a.cc:23:42: error: 'cos' was not declared in this scope; did you mean 'const'?
   23 |     double length_ji = A*A + B*B -(2*A*B*cos(pi*(diff/180.)));
      |                                          ^~~
      |                                          const
a.cc:24:19: error: 'sqrt' was not declared in this scope
   24 |     printf("%.9f",sqrt(length_ji));
      |                   ^~~~
a.cc:24:5: error: 'printf' was not declared in this scope
   24 |     printf("%.9f",sqrt(length_ji));
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #define vi vector<int>
Language: C

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

int main(int argc, char *argv[]){

  int a, b, h, m;
  scanf("%d %d %d %d", &a, &b, &h, &m);
  //printf("%d %d %d %d\n", a, b, h, m);

  int angle;
  int angle_h = (h * 30) + (m / 2);
  int angle_m = m * 6;
  if(angle_h>angle_m){
    angle = angle_h - angle_m;
  }else if(angle_h == angle_m){
    printf("0\n");
    exit;
  }else{
    angle = angle_m - angle_h;
  }
  if(angle > 180) angle = 360 - angle;
  //printf("angle_h=%d, angle_m=%d, angle=%d\n", angle_h, angle_m, angle);

  double p = 3.141592653589793238462643383279;
  double c = sqrt((a * a) + (b * b) - 2 * (a * b *cos(angle * p / 180.0)));
  printf("%5.20lf\n", c);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:5: error: 'exit' undeclared (first use in this function)
   17 |     exit;
      |     ^~~~
main.c:3:1: note: 'exit' is defined in header '<stdlib.h>'; this is probably fixable by adding '#include <stdlib.h>'
    2 | #include<math.h>
  +++ |+#include <stdlib.h>
    3 | 
main.c:17:5: note: each undeclared identifier is reported only once for each function it appears in
   17 |     exit;
      |     ^~~~
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      	int A = sc.nextInt();
      	int B = sc.nextInt();
      	int H = sc.nextInt();
      	int M = sc.nextInt();
      	if(H == 0) H = 12;
		double H2 = (H * 60 + M) * 360 / (12 * 60);
        double M2 = M * 360 / 60;
      	if (M2 == 0) M2 = 360;
      	double kakudo = 0;
      	if(M2 > H2){
	      kakudo = M2 - H2;
        }
      	else{
          kakudo = H2 - M2;
    	}
      	
      	kakudo = Math.min(kakudo,360-kakudo);
      	//System.out.println(kakudo);
      	
         double cos = Math.cos(Math.toRadians(kakudo));
      	 ans = Math.sqrt((A*A)+(B*B)-(2*A*B*cos));

         System.out.println(ans);
    }
}

Compiler output:
Main.java:26: error: cannot find symbol
      	 ans = Math.sqrt((A*A)+(B*B)-(2*A*B*cos));
      	 ^
  symbol:   variable ans
  location: class Main
Main.java:28: error: cannot find symbol
         System.out.println(ans);
                            ^
  symbol:   variable ans
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define PI 3.14159265358979

const long double eps = 1.0e-18;

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

long double COS(long double x){
long double t;
long double y;
int n;

y = 1.0;
t = 1.0;
n = 1;

while( 1 ){
t = -t*x*x/((2*n)*(2*n-1));
if(fabs(t)<=0.000000001) break;
y = y + t;
n++;
}
return y;
}

int main() {
  long double a, b, h, m;
  cin >> a >> b >> h >> m;
  long double complex = cosl(((h * 60.000000000000 - 11.000000000000 * m) / 360.000000000000) * PI);
  long double ans2 = (a * a) + (b * b) - 2.000000000000 * (a * b) * complex;
  long double ans = mysqrtl(ans2);
  cout << fixed << setprecison(15) << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:20: error: 'setprecison' was not declared in this scope
   41 |   cout << fixed << setprecison(15) << ans << endl;
      |                    ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define PI 3.14159265358979

const long double eps = 1.0e-18;

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

long double COS(long double x){
long double t;
long double y;
int n;

y = 1.0;
t = 1.0;
n = 1;

while( 1 ){
t = -t*x*x/((2*n)*(2*n-1));
if(fabs(t)<=0.000000001) break;
y = y + t;
n++;
}
return y;
}

int main() {
  long double a, b, h, m;
  cin >> a >> b >> h >> m;
  long double complex = cosl(((h * 60.000000000000 - 11.000000000000 * m) / 360.000000000000) * PI);
  long double ans2 = (a * a) + (b * b) - 2.000000000000 * (a * b) * complex;
  long double ans = mysqrtl(ans2);
  cout << fixed <<setprecison(15) << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:19: error: 'setprecison' was not declared in this scope
   41 |   cout << fixed <<setprecison(15) << ans << endl;
      |                   ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define PI acos(-1)
using namespace std;
int main() {
	double a, b, h, m; cin >> a >> b >> h >> m;
	double a1 = abs(5.0 * (h + m / 60.0) - m);
	double a2 = 60.0 - angle1;
	double a3 = 2.0 * PI * min(a1, a2) / 60.0;
	printf("%.9f", sqrt(a * a + b * b - 2 * a * b * cos(a3)));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: 'angle1' was not declared in this scope
    7 |         double a2 = 60.0 - angle1;
      |                            ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fi(i,a,b) for(ll i=a-1;i>=b;i--)
#define endl '\n'
#define spc " "
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define pi 3.14159265358979323

void Fast_IO() {
   ios::sync_with_stdio(0);
   cin.tie(0);
   #ifndef ONLINE_JUDGE
   freopen("in.txt","r",stdin);
   freopen("output.txt","w",stdout);
   #endif
} 

vector<vector<ll> >vii;
int main(){
   //Fast_IO();
   double a,b,h,m;
   cin>>a>>b>>h>>m;
   double x = (h*60+m)/2;  
   double y = 6*m;   
   double angle = abs(x - y);  
   angle = min(360 - angle, angle); 
   cout<<angle<<spc;

   if(angle==180){
      double ans = a+b;
      cout<<fixed<<setprecision(18)<<ans;
   }
   else if(angle==0){
      double ans = abs(a-b);
      cout<<fixed<<setprecision(18)<<ans;
   }
   else{
      angle = angle*k;
      double p = cos(angle);
      cout<<p<<spc;
      if(p<-1) p=0;
      double ans=0.000000000000000001;
      ans+=pow(a,2)+pow(b,2)- 2*a*b*p;
      ans = sqrt(ans);

      cout<<fixed<<setprecision(18)<<ans;
   }
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:21: error: 'k' was not declared in this scope
   43 |       angle = angle*k;
      |                     ^
Language: C++

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

int main() {
  double A,B,H,M;
  cin >> A >> B >> H >> M;
  double a;
  double b;
  a = H*M*M_PI;
  b = M*M_PI;
  double kakudo;
  double hanare;
  kakudo = max(a,b)-min(a,b);
  if(kakudo>=M_PI){
    kakudo= 2*M_PI-kakudo
  hanare = a*a+b*b-2*a*b*cos(kakudo);
  cout << hanare << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: expected ';' before 'hanare'
   15 |     kakudo= 2*M_PI-kakudo
      |                          ^
      |                          ;
   16 |   hanare = a*a+b*b-2*a*b*cos(kakudo);
      |   ~~~~~~                  
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define PI 3.14159265358979

const long double eps = 1.0e-18;

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

long double COS(long double x){
long double t;
long double y;
int n;

y = 1.0;
t = 1.0;
n = 1;

while( 1 ){
t = -t*x*x/((2*n)*(2*n-1));
if(fabs(t)<=0.000000001) break;
y = y + t;
n++;
}
return y;
}

int main() {
  long double a, b, h, m;
  cin >> a >> b >> h >> m;
  long double complex = cosl(((h * 60.000000000000 - 11.000000000000 * m) / 360.000000000000) * PI);
  long double ans2 = (a * a) + (b * b) - 2.000000000000 * (a * b) * complex;
  long double ans = mysqrtl(ans2);
  cout << ans.precision(10) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:15: error: request for member 'precision' in 'ans', which is of non-class type 'long double'
   41 |   cout << ans.precision(10) << endl;
      |               ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fi(i,a,b) for(ll i=a-1;i>=b;i--)
#define endl '\n'
#define spc " "
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define pi 3.14159265358979323

void Fast_IO() {
   ios::sync_with_stdio(0);
   cin.tie(0);
   #ifndef ONLINE_JUDGE
   freopen("in.txt","r",stdin);
   freopen("output.txt","w",stdout);
   #endif
} 

vector<vector<ll> >vii;
int main(){
   //Fast_IO();
   double a,b,h,m;
   cin>>a>>b>>h>>m;
   double x = (h*60+m)/2;  
   double y = 6*m;   
   double angle = abs(x - y);  
   angle = min(360 - angle, angle); 
   cout<<angle<<spc;
   ia
   if(angle==180){
      double ans = a+b;
      cout<<fixed<<setprecision(18)<<ans;
   }
   else if(angle==0){
      double ans = abs(a-b);
      cout<<fixed<<setprecision(18)<<ans;
   }
   else{
      angle = angle*k;
      double p = cos(angle);
      cout<<p<<spc;
      if(p<-1) p=0;
      double ans=0.000000000000000001;
      ans+=pow(a,2)+pow(b,2)- 2*a*b*p;
      ans = sqrt(ans);

      cout<<fixed<<setprecision(18)<<ans;
   }
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:4: error: 'ia' was not declared in this scope; did you mean 'a'?
   33 |    ia
      |    ^~
      |    a
a.cc:38:4: error: 'else' without a previous 'if'
   38 |    else if(angle==0){
      |    ^~~~
a.cc:43:21: error: 'k' was not declared in this scope
   43 |       angle = angle*k;
      |                     ^
Language: C++

#include <iostream>
#include <cmath>
#define pi 3.14159265358979323846
using namespace std;

int main(){
  double A, B, H, M;
  cin >> A >>B >>H >>M;
  double theta = abs(30.0*H- 5.5*M);
  theta = sqrt(A*A + B*B - 2*A*B*cos(theta/180 * pi));
  cout.precision(20)
  cout <<theta <<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: expected ';' before 'cout'
   11 |   cout.precision(20)
      |                     ^
      |                     ;
   12 |   cout <<theta <<endl;
      |   ~~~~
Language: C++

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


int main(){
  int A,B,H,M;
  cin>>A>>B>>H>>M;
  H*=60;
  int m=M*6;
  int h=(H+M)/2;
  int S=h-m;
  long double c=sqrt(A*A+B*B-2*A*B*cos(S*M_PI/180));
  long double S=A*A+B*B-2*A*B*cos(S*M_PI/180);
  long double C=c*c;
  if((C-S)>0.000000001){
    c-=0.000000001;}
  if((S-C)>0.000000001){
    c+=0.000000001;}
  cout<<fixed<<setprecision(10)<<c<<endl;
 
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: conflicting declaration 'long double S'
   14 |   long double S=A*A+B*B-2*A*B*cos(S*M_PI/180);
      |               ^
a.cc:12:7: note: previous declaration as 'int S'
   12 |   int S=h-m;
      |       ^
Language: Java

import java.io.*;
import java.util.*;


public class gym{
	static void main() throws Exception{
		double a=sc.nextInt(),b=sc.nextInt(),h=sc.nextInt()*5,m=sc.nextInt();
		h+=m/(12);
		double dif=Math.min(Math.abs(h-m), 60-Math.abs(h-m));
		System.out.println(dif);
		double cosa=Math.cos(dif*2*Math.PI/60);
		pw.println(Math.sqrt(a*a+b*b-2*cosa*a*b));
	}
	public static void main(String[] args) throws Exception{
		pw=new PrintWriter(System.out);
		sc = new MScanner(System.in);
		int tc=1;
		while(tc-->0)main();
		pw.flush();
	}
	static PrintWriter pw;
	static MScanner  sc;
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] intArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] longArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public int[] intSortedArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public long[] longSortedArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public Integer[] IntegerArr(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] LongArr(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
	static void shuffle(int[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			int tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static void shuffle(long[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			long tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
}

Compiler output:
Main.java:5: error: class gym is public, should be declared in a file named gym.java
public class gym{
       ^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define PI 3.14159265358979

const long double eps = 1.0e-18;

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

long double COS(long double x){
long double t;
long double y;
int n;

y = 1.0;
t = 1.0;
n = 1;

while( 1 ){
t = -t*x*x/((2*n)*(2*n-1));
if(fabs(t)<=0.000000001) break;
y = y + t;
n++;
}
return y;
}

int main() {
  long double a, b, h, m;
  cin >> a >> b >> h >> m;
  long double complex = cosl(((h * 60.000000000000 - 11.000000000000 * m) / 360.000000000000) * PI);
  long double ans2 = (a * a) + (b * b) - 2.000000000000 * (a * b) * complex;
  long double ans = mysqrtl(ans2);
  cout << ans.setprecision(10) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:15: error: request for member 'setprecision' in 'ans', which is of non-class type 'long double'
   41 |   cout << ans.setprecision(10) << endl;
      |               ^~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cmath>
#define pi 3.14159265358979323846
using namespace std;

int main(){
  double A, B, H, M;
  cin >> A >>B >>H >>M;
  double theta = abs(30.0*H- 5.5*M);
  theta = sqrt(A*A + B*B - 2*A*B*cos(theta/180 * pi));
  cout << setprecision(20) <<theta <<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: 'setprecision' was not declared in this scope
   11 |   cout << setprecision(20) <<theta <<endl;
      |           ^~~~~~~~~~~~
a.cc:3:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    2 | #include <cmath>
  +++ |+#include <iomanip>
    3 | #define pi 3.14159265358979323846
Language: C++

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

int main(void){
  	long double PI=3.1415926535897932;
  	long double A,B,H,M;
  	scanf("%llf%llf%llf%llf",&A,&B,&H,&M);
  	long double XA,YA,XB,YB;
  	
  	long double Arad = PI*5/2-H*2*M_PI/12-M*2*M_PI/720;
  	long double Brad = PI*5/2-M*2*M_PI/60;
  	long double eps = 1000;
  	XA = A*cos(Arad);
  	YA = A*sin(Arad);
  	XB = B*cos(Brad);
  	YB = B*sin(Brad);
	long double x_dis = XA-XB;
	long double y_dis = YA-YB; 
  	long double xhoge = x_dis*x_dis;
  	long double yhoge = y_dis*y_dis;
  	long double ans = sqrt(xhoge+yhoge)*eps;
    	printf("%llf\n",ans);
  	printf("%llf",ans/eps);
  long double ans2 = ans *eps*eps;
  int ans3 = (int)ans2%1000
      	printf("%llf",ans3);
  	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: expected ',' or ';' before 'printf'
   29 |         printf("%llf",ans3);
      |         ^~~~~~
Language: C

include <stdio.h>
#include <math.h>
int main(){
  int A,B,H,M;
  scanf("%d %d %d %d",&A,&B,&H,&M);
  double L;
  L=sqrt(pow(A*cos(M_PI/6*H+M_PI/360*M)-B*cos(M_PI/30*M),2)+pow(A*sin(M_PI/6*H+M_PI/360*M)-B*sin(M_PI/30*M),2));
  printf("%lf\n",L);
  return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   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:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d %d %d %d",&A,&B,&H,&M);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |   printf("%lf\n",L);
      |   ^~~~~~
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <string>
#include <complex>
#include <cmath>
#include <iostream>
#include <iomanip>

int A, B, H, M;
double gannma, c ,zeta;
const double PI=3.14159265358979323846;

int main() {
  std::cin >> A >> B >> H >> M;
  zeta = std::abs(((double)(H+((double)M)/60))/12 - ((double)M)/60);
  gannma = 2 * PI * (zeta > 0.5 ? zeta - 0.5 : zeta) ;
  c = std::sqrt(std::abs(A*A + B*B - 2*A*B*std::cos(gannma)));

  std::cout << << std::fixed << std::setprecision(10) <<  c << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: expected primary-expression before '<<' token
   22 |   std::cout << << std::fixed << std::setprecision(10) <<  c << std::endl;
      |                ^~
Language: C++

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

int main() {
  int A, B, H, M, R;
  cin >> A >> B >> H >> M;
  R = (A*A + B*B - 2*A*B*cos(60*(H + H + H + H + H - M));
  cout << sqrt(R) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:57: error: expected ')' before ';' token
    7 |   R = (A*A + B*B - 2*A*B*cos(60*(H + H + H + H + H - M));
      |       ~                                                 ^
      |                                                         )
Language: C

#include<stdio.h>
#include<math.h>
int main()
{
  int a,b,h,m;
  scanf("%d%d%d%d",&a,&b,&h,&m);
  float ng=1/2(60*h-11*m);
  if(ng<0)
    ng*=-1;
  ng=(ag*3.14/180);
  printf("%f",cos(ng)*a);
}


Compiler output:
main.c: In function 'main':
main.c:7:14: error: called object is not a function or function pointer
    7 |   float ng=1/2(60*h-11*m);
      |              ^
main.c:10:7: error: 'ag' undeclared (first use in this function); did you mean 'ng'?
   10 |   ng=(ag*3.14/180);
      |       ^~
      |       ng
main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;

int main () {
 int a, b, h, m; // a:時針 b:分針 h, m: h時m分
 const double PI=3.1415926535897932;
 double rh_vec, rm_vec;
 double radian;
 double ans;
 
 cin >> a >> b >> h >> m;
 
 a = (double)a;
 b = (double)b;
 h = (double)h;
 m = (double)m;
 
 rh_vec = PI / 6.0;
 rm_vec = PI / 30.0;
 
 radian = rh_vec * (double)(h + m / 60.0) - rm_vec * (double)m;
 

 
 ans = sqrt(a * a + b * b - 2.0 * a * b * cos(radian));
 
 cout << setprecision(15) <<　ans <<  endl;
 
 return 0;
 }


Compiler output:
a.cc:29:29: error: extended character 　 is not valid in an identifier
   29 |  cout << setprecision(15) <<　ans <<  endl;
      |                             ^
a.cc: In function 'int main()':
a.cc:29:29: error: '\U00003000ans' was not declared in this scope
   29 |  cout << setprecision(15) <<　ans <<  endl;
      |                             ^~~~~
Language: C++

#include <bits/stdc++.h>
#include<iostream>
#include<string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pai 3.141592653589793

int main() {
  int a,b,h,m;
  cin >> a >> b >> h >> m;
  float ha = 0;
  if (m == 0) {
    ha = 30 * h;
  } else {
    ha = (30 * h) + (m / 2);
   }
  int ma = 6 * m;
  if (ha == ma) {
    cout << b -a;
  } else if (ha > ma) {
    
    if ((ha - ma) == 180) {
      cout << a + b;
    } else if ((ha - ma) > 180) {
      long double ca = pai / 180 * (ha - ma - 180);
      long double ans = long double sqrt((a * a) + (b * b) - (cos(ca) * 2 * a * b) );
      cout << ans;
    } else {
      long double ca = pai / 180 * (ha - ma);
      long double ans = long double sqrt((a * a) + (b * b) - (cos(ca) * 2 * a * b) );
      cout << ans;
    }
    
  } else {
    
    if ((ma - ha) == 180) {
      cout << a + b;
    } else if ((ma - ha) > 180) {
      long double ca = pai / 180 * (ma - ha - 180);
      long double ans = long double sqrt((a * a) + (b * b) - (cos(ca) * 2 * a * b) );
      cout << ans;
    } else {
      long double ca = pai / 180 * (ma - ha);
      long double ans = long double sqrt((a * a) + (b * b) - (cos(ca) * 2 * a * b) );
      cout << ans;
    }
    
  }
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: expected primary-expression before 'long'
   26 |       long double ans = long double sqrt((a * a) + (b * b) - (cos(ca) * 2 * a * b) );
      |                         ^~~~
a.cc:30:25: error: expected primary-expression before 'long'
   30 |       long double ans = long double sqrt((a * a) + (b * b) - (cos(ca) * 2 * a * b) );
      |                         ^~~~
a.cc:40:25: error: expected primary-expression before 'long'
   40 |       long double ans = long double sqrt((a * a) + (b * b) - (cos(ca) * 2 * a * b) );
      |                         ^~~~
a.cc:44:25: error: expected primary-expression before 'long'
   44 |       long double ans = long double sqrt((a * a) + (b * b) - (cos(ca) * 2 * a * b) );
      |                         ^~~~
Language: C++

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

int main(){
  int a, b, h, m;
  double l2, a_rad, b_rad, d_rad;
  
  a_rad = (30 * h) + (0.2 * m);
  b_rad = 6 * m;
  
  if(a_rad > b_rad){
    d_rad = a_rad - b_rad;
    d_rad *= pi / 180;
    l2 = pow(a, 2.0) + pow(b, 2.0) + 2 * a * b * cos(d_rad);
    cout << sqrt(l2) << endl;
  }
  else{
    d_rad = b_rad - a_rad;
    d_rad *= pi / 180;
    l2 = pow(a, 2.0) + pow(b, 2.0) + 2 * a * b * cos(d_rad);
    cout << sqrt(l2) << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'pi' was not declared in this scope
   13 |     d_rad *= pi / 180;
      |              ^~
a.cc:19:14: error: 'pi' was not declared in this scope
   19 |     d_rad *= pi / 180;
      |              ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define PI 3.14159265358979

const long double eps = 1.0e-18;

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

long double COS(long double x){
long double t;
long double y;
int n;

y = 1.0;
t = 1.0;
n = 1;

while( 1 ){
t = -t*x*x/((2*n)*(2*n-1));
if(fabs(t)<=0.000000001) break;
y = y + t;
n++;
}
return y;
}

int main() {
  long double a, b, h, m;
  cin >> a >> b >> h >> m;
  long double complex = cosl(((h * 60.000000000000 - 11.000000000000 * m) / 360.000000000000) * PI);
  long double ans2 = (a * a) + (b * b) - 2.000000000000 * (a * b) * complex;
  long double ans = mysqrtl(ans2);
  cout << ans(10) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:14: error: 'ans' cannot be used as a function
   41 |   cout << ans(10) << endl;
      |           ~~~^~~~
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      	int A = sc.nextInt();
      	int B = sc.nextInt();
      	int H = sc.nextInt();
      	int M = sc.nextInt();
      	if(H == 0) H = 12;
		int H2 = (H * 60 + M) * 360 / (12 * 60);
        int M2 = M * 360 / 60;
      	if (M2 == 0) M2 = 360;
      	int kakudo = 0;
      	if(M2 > H2){
	      kakudo = M2 - H2;
        }
      	else{
          kakudo = H2 - M2;
    	}
      	
      	kakudo = Math.min(kakudo,360-kakudo);
      	//System.out.println(kakudo);
      	
      	double ans = 0.0;
      	if(kakudo==0){ans = 0;}
      	else{
         floot cos = Math.cos(Math.toRadians(kakudo));
      	 ans = Math.sqrt((A*A)+(B*B)-(2*A*B*cos));
        }
          System.out.println(ans);
    }
}

Compiler output:
Main.java:28: error: cannot find symbol
         floot cos = Math.cos(Math.toRadians(kakudo));
         ^
  symbol:   class floot
  location: class Main
1 error
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <string>

using namespace std;

int main() {
  long double pi = 3.14159265358979323846;
  long double A, B, H, M;
  cin >> A >> B >> H >> M;
  long double angle = abs((60 * H + M) * pi / 360 - M * pi / 30);
  cout << fixed << setprecision(10) << sqrt(A * A + B * B - 2 * A * B * cos(angle)) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: 'setprecision' was not declared in this scope
   13 |   cout << fixed << setprecision(10) << sqrt(A * A + B * B - 2 * A * B * cos(angle)) << endl;
      |                    ^~~~~~~~~~~~
a.cc:4:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    3 | #include <cmath>
  +++ |+#include <iomanip>
    4 | #include <string>
Language: Java

import java.util.*;
import java.util.Arrays;
public class Main{
    
    
    public static void main(String[] args){
       Scanner sc = new Scanner(System.in);
       int a =  sc.nextInt();
       int b =  sc.nextInt();
       int h =  sc.nextInt();
       int m=  sc.nextInt();
       int time = h*60+m;
       double w = (double)(time%360*5.5);
       final double d = w;
       while(w>0){
           r = w/360;
           w = w- r*360;

       }
       double len = Math.sqrt(a*a+b*b-2*a*b*(Math.cos(w/180*(Math.PI))));
    
       System.out.println(len);

       
    }
   
    
       
    
}

Compiler output:
Main.java:16: error: cannot find symbol
           r = w/360;
           ^
  symbol:   variable r
  location: class Main
Main.java:17: error: cannot find symbol
           w = w- r*360;
                  ^
  symbol:   variable r
  location: class Main
2 errors
Language: C++

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


int main() {
double a, b, n, m;
  cin >> a >> b >> n >> m;
  
  cout << sqrt(a*a+b*b-2*a*b*cos(abs(6*m-(m/2+30*h))/π) << endl;
  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:50: error: 'h' was not declared in this scope
    9 |   cout << sqrt(a*a+b*b-2*a*b*cos(abs(6*m-(m/2+30*h))/π) << endl;
      |                                                  ^
a.cc:9:54: error: '\U000003c0' was not declared in this scope
    9 |   cout << sqrt(a*a+b*b-2*a*b*cos(abs(6*m-(m/2+30*h))/π) << endl;
      |                                                      ^
Language: C++

#include <iostream>

#include <boost/multiprecision/cpp_dec_float.hpp>

namespace mp = boost::multiprecision;

using cpp_dec_float = mp::number<mp::cpp_dec_float<30>>;


int main(){
  int A,B,H,M;
  std::cin >> A >> B >> H >> M;
  cpp_dec_float PI = 3.14159265359;
  cpp_dec_float w1 = (PI/30)*(H*60+M);
  cpp_dec_float w2 = (PI/360)*(H*60+M);
  cpp_dec_float x;
  x = sqrt(A*A + B*B -2*A*B*cos(w1-w2));
  std::cout << x << endl;

  return 0;
}


Compiler output:
a.cc:3:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
    3 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main()
{
    int a;
    int b;
    int h;
    int m;

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

    float pi = 3.14159265359;
    float wa = (2*pi)/60;
    float wb = (2 * pi) / 12;

    float c = a * a + b * b - 2 * a * b * cos(wa * m - wb * h);
    float ca = sqrt(c);

    std::cout << ca;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:43: error: 'cos' was not declared in this scope
   21 |     float c = a * a + b * b - 2 * a * b * cos(wa * m - wb * h);
      |                                           ^~~
a.cc:22:16: error: 'sqrt' was not declared in this scope
   22 |     float ca = sqrt(c);
      |                ^~~~
Language: C++

#include <bits/stdc++.h>
#include <cmath>
#include <iostream>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007
int main() {
	long double a,b,h,m;
	cin>>a>>b>>h>>m;
	long double A=h*30.0+m/2.0;
	long double B=6.0*m;
	long double now=double(abs(A-B));
	if(now>=180.0){
		now=now-180.0;
	}
	now=now*2.0*M_PI/360.0;
	long double cosl( now);
	NOW=cosl(now);
    long double ans=-2.0*a*b*NOW+a*a+b*b;
	ans=sqrt(ans);
	cout <<printf("%.10Lf",ans);
	// your code goes here
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'NOW' was not declared in this scope
   19 |         NOW=cosl(now);
      |         ^~~
a.cc:19:17: error: 'cosl' cannot be used as a function
   19 |         NOW=cosl(now);
      |             ~~~~^~~~~
Language: C++

#include <iostream>
using namespace std;
const double pi = 3.141592653589793;
 
int main() {
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  double angle_a = H * pi / 6.0000000000 + pi / 360.0000000000 * M;
  double angle_b = pi / 3.0000000000 * M;
  
  double diff = abs(angle_a - angle_b) < 180 ? 
    abs(angle_a - angle_b)
    : 180 - (angle_a - angle_b);
  double ans = sqrt(A * A + B * B - 2 * A * B * cos(diff));
  cout << ans << endl;
  return 0;   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:49: error: 'cos' was not declared in this scope
   14 |   double ans = sqrt(A * A + B * B - 2 * A * B * cos(diff));
      |                                                 ^~~
a.cc:14:16: error: 'sqrt' was not declared in this scope
   14 |   double ans = sqrt(A * A + B * B - 2 * A * B * cos(diff));
      |                ^~~~
Language: C++

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

int main(){
  int a, b, h, m;
  double l2, a_rad, b_rad, d_rad;
  
  a_rad = (30 * h) + (0.2 * m);
  b_rad = 6 * m;
  
  if(a_rad > b_rad){
    d_rad = a_rad - b_rad;
    d_rad *= pi / 180;
    l2 = pow(a, 2.0) + pow(b, 2.0) + 2 * a * b * cos(d_rad);
    cout << sqrt(ls) << endl;
  }
  else{
    d_rad = b_rad - a_rad;
    d_rad *= pi / 180;
    l2 = pow(a, 2.0) + pow(b, 2.0) + 2 * a * b * cos(d_rad);
    cout << sqrt(ls) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'pi' was not declared in this scope
   13 |     d_rad *= pi / 180;
      |              ^~
a.cc:15:18: error: 'ls' was not declared in this scope; did you mean 'l2'?
   15 |     cout << sqrt(ls) << endl;
      |                  ^~
      |                  l2
a.cc:19:14: error: 'pi' was not declared in this scope
   19 |     d_rad *= pi / 180;
      |              ^~
a.cc:21:18: error: 'ls' was not declared in this scope; did you mean 'l2'?
   21 |     cout << sqrt(ls) << endl;
      |                  ^~
      |                  l2
Language: C++

import math

stdata = [0]*4
stdata = input().split()
plase = [0] * 4
plase[0] = float(stdata[0]) * math.sin(math.pi * 2 / 12 * float(stdata[2]))
plase[1] = float(stdata[0]) * math.cos(math.pi * 2 / 12 * float(stdata[2]))
plase[2] = float(stdata[1]) * math.sin(math.pi * 2 / 60 * float(stdata[3]))
plase[3] = float(stdata[1]) * math.cos(math.pi * 2 / 60 * float(stdata[3]))
temp = math.sqrt(float(plase[2] - plase[0]) * float(plase[2] - plase[0]) + float(plase[3] - plase[1]) * float(plase[3] - plase[1]))
print(temp)
print(stdata , plase)

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'
Language: C++

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

int main() {
  int a,b,h,m;
  double pi = 3.141592653589793;
  double aa, ab,angle ;
  double d;
  cin >> b >> a >> h >> m;
  aa = a * 30 + b * 30 / 60 ; 
  bb = b * 6 ;
  if(aa >= bb) angle = aa - bb ;
  else angle = bb - aa ;
  if(angle == 0) cout << b - a;
  else if(angle == 180) cout << b + a ;
  else{
    angle = pi / angle ;
    d = a * a + b * b - 2 * a * b * cos(angle);
    d = sqrt(d);
    cout << d ;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'bb' was not declared in this scope; did you mean 'ab'?
   11 |   bb = b * 6 ;
      |   ^~
      |   ab
Language: Java

import java.util.Scanner;
import java.util.*;
public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
      //数字の数を入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int h = sc.nextInt();
		int m = sc.nextInt();
      //短針が進む角度
      double tanshin = 0.5 *m + 30*h;
      //長針
      double tyoshin = 6 * m;
      //なす角度
      double kakudo = tanshin - tyoshin;

        if(kakudo > 180){
        	kakudo = 360 - kakudo;
      	}
        if(kakudo < 0){
        	kakudo *= -1;
        }
        
      	double result2 = a*a + b*b - 2*a*b* Math.cos(Math.toRadians(kakudo));
      	double result = Math.sqrt(result2);
      	System.out.println(result);
      
      }             
      
	}

}


Compiler output:
Main.java:34: error: class, interface, enum, or record expected
}
^
1 error
Language: C++

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

int main() {
  int a,b,h,m;
  double pi = 3.141592653589793
  double aa, ab,angle ;
  double d;
  cin >> b >> a >> h >> m;
  aa = a * 30 + b * 30 / 60 ; 
  bb = b * 6 ;
  if(aa >= bb) angle = aa - bb ;
  else angle = bb - aa ;
  if(angle == 0) cout << b - a;
  else if(angle == 180) cout << b + a ;
  else{
    angle = pi / angle ;
    d = a * a + b * b - 2 * a * b * cos(angle);
    d = sqrt(d);
    cout << d ;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'double'
    7 |   double aa, ab,angle ;
      |   ^~~~~~
a.cc:10:3: error: 'aa' was not declared in this scope; did you mean 'a'?
   10 |   aa = a * 30 + b * 30 / 60 ;
      |   ^~
      |   a
a.cc:11:3: error: 'bb' was not declared in this scope; did you mean 'b'?
   11 |   bb = b * 6 ;
      |   ^~
      |   b
a.cc:12:16: error: 'angle' was not declared in this scope
   12 |   if(aa >= bb) angle = aa - bb ;
      |                ^~~~~
a.cc:13:8: error: 'angle' was not declared in this scope
   13 |   else angle = bb - aa ;
      |        ^~~~~
a.cc:14:6: error: 'angle' was not declared in this scope
   14 |   if(angle == 0) cout << b - a;
      |      ^~~~~
Language: C

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

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

    double h = (double)(H * 60 + M) * 0.5;
    double m = (double)M * 6;
    double hTheta = (90 - h) * (M_PI / 180);
    double mTheta = (90 - m) * (M_PI / 180);
    
    // printf("%f %f \n", h, m);
    // printf("%f %f\n", cos(hTheta), cos(mTheta));

    double a = fabs(A * cos(hTheta) - B * cos(mTheta));
    double b = fabs(A * sin(hTheta) - B * sin(mTheta));

    // printf("%f %f\n", a, b);
    
    double c = sqrt(pow(a, 2.0) + pow(b, 2.0));

    printf("%f\n",c);
    return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccWwz7Gt.o: in function `main':
main.c:(.text+0xd0): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0xf8): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x139): undefined reference to `sin'
/usr/bin/ld: main.c:(.text+0x161): undefined reference to `sin'
/usr/bin/ld: main.c:(.text+0x19e): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x1bd): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x1d5): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status