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

#include<iostream>
#include<queue>
#include<string>
#include<vector>
#include<math.h>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include<stack>
#include<sstream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<list>
#include<numeric>
typedef long long ll;

#define pi 3.14159265358979323846264338327950L
#define VI vector<int>
#define VLL vector<long long>
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
const ll MOD = 1e9 + 7;
using namespace std;
template<typename T>
T gcd(T a, T b) {
	if (b == 0) return a;
	return gcd(b, a % b);
	//return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	ll g = gcd(a, b);
	return a / g * b; // Be careful not to overflow
	//return a * b / gcd(a, b);
}

template<typename T>
T binarysearch(vector<T> A, T key) {
	ll left = 0;ll right = 4;ll mid;
	while (left < right) {
		mid = (left + right) / 2;
		if (key == A[mid]) return 1;
		if (key > A[mid]) left = mid + 1;
		else if (key < A[mid]) right = mid;
	}
	return 0;
}

template<typename T>
T finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return 1;
	}
	else { // 発見できなかったとき
		return 0;
	}
}
ll frac(ll n)//階乗
{
	if (n == 0) {
		return 1;
	}
	return (n * frac(n - 1)) % MOD;
}

template<typename T>
T keta(T a) {
	ll kazu = 1;
	while (1) {
		if (a / 10 != 0) { a /= 10;kazu++; }
		else break;
	}
	return kazu;
}//桁数

//素数判定
template<typename T>
bool IsPrime(T num)
{
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			// 素数ではない
			return false;
		}
	}

	// 素数である
	return true;
}

template<typename T>
T nCr(ll n, T r) {
	ll ans = 1;
	for (int i = n; i > n - r; --i) {
		ans = ans * i;
	}
	for (int i = 1; i < r + 1; ++i) {
		ans = ans / i;
	}
	return ans;
}
/*char r[4];
int yaju[4];
char op[3];
int sum = 0;
scanf("%s", r);
for (int i = 0;i < 4;i++) {
	yaju[i] = r[i] - '0';
}
*/
//vector<vector<int>> data(3, vector<int>(4));
//vector<vector<Type>> vv(n);

int main() {
	//ll K; ll ans = 0;cin >> K;
	ll A, B, H, M;cin >> A >> B >> H >> M;
	//string S;cin >> S;
	long double mina = 0;
	long double ans = 0;
	vector<ll>sum;
	//vector<ll>C(N);
	//vector<ll>S(N), F(N);
	//for (ll i = 1;i < N;i++)cin >> C[i] >> S[i] >> F[i];
	mina = pi * 2 * ((long double)H / 12.0 + (long double)(M / 60.0) / 12.0 - (long double)M / 60.0);
	ans = long double(A * A) + long double(B * B) - long double(2 * A * B * cos(mina));
	cout << fixed << setprecision(20) << sqrtl(ans) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:136:15: error: expected primary-expression before 'long'
  136 |         ans = long double(A * A) + long double(B * B) - long double(2 * A * B * cos(mina));
      |               ^~~~
Language: C++

import math

a,b,h,m=map(int, input().split())

angle = abs(h*30+m/2 - m*6)
print(format(math.sqrt((a**2 + b**2) - (2*a*b*math.cos((angle*math.pi)/180))), '.18f'))

Compiler output:
a.cc:6:80: warning: multi-character character constant [-Wmultichar]
    6 | print(format(math.sqrt((a**2 + b**2) - (2*a*b*math.cos((angle*math.pi)/180))), '.18f'))
      |                                                                                ^~~~~~
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: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int A = scan.nextInt();
    int B = scan.nextInt();
    int H = scan.nextInt();
    int M = scan.nextInt();
    int h = (double)H*30;
    int m = (double)M*6;
    double ans = Math.sqrt(A*A + B*B - 2*A*B*Math.cos(Math.toRadians(Math.abs(h-m))));
    System.out.println(ans);
  }
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from double to int
    int h = (double)H*30;
                     ^
Main.java:10: error: incompatible types: possible lossy conversion from double to int
    int m = (double)M*6;
                     ^
2 errors
Language: C++

signed main() {
	double A, B, H, M;
	double cm,radA,radB,rad,ten;
	double l2, l60, l12;
	l12 = 12.000000000000000;
	l60 = 60.000000000000000;
	l2 = 2.000000000000000;

	cin >> A >> B >> H >> M;
	radA = l2 * PI*(H+M/l60) / l12;
	radB = l2 * PI*M / l60;
	rad = abs(radA - radB);
	if (rad >= PI) {
		rad = abs(l2* PI - rad);
	}
	ten = l2*A*B*cos(rad);
	cm = sqrt(A*A + B*B - ten);
	cout << fixed << setprecision(15) << cm << endl;
	pause;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin >> A >> B >> H >> M;
      |         ^~~
a.cc:10:21: error: 'PI' was not declared in this scope
   10 |         radA = l2 * PI*(H+M/l60) / l12;
      |                     ^~
a.cc:12:15: error: 'abs' was not declared in this scope
   12 |         rad = abs(radA - radB);
      |               ^~~
a.cc:16:22: error: 'cos' was not declared in this scope
   16 |         ten = l2*A*B*cos(rad);
      |                      ^~~
a.cc:17:14: error: 'sqrt' was not declared in this scope
   17 |         cm = sqrt(A*A + B*B - ten);
      |              ^~~~
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << fixed << setprecision(15) << cm << endl;
      |         ^~~~
a.cc:18:17: error: 'fixed' was not declared in this scope
   18 |         cout << fixed << setprecision(15) << cm << endl;
      |                 ^~~~~
a.cc:18:26: error: 'setprecision' was not declared in this scope
   18 |         cout << fixed << setprecision(15) << cm << endl;
      |                          ^~~~~~~~~~~~
a.cc:18:52: error: 'endl' was not declared in this scope
   18 |         cout << fixed << setprecision(15) << cm << endl;
      |                                                    ^~~~
a.cc:19:9: error: 'pause' was not declared in this scope
   19 |         pause;
      |         ^~~~~
Language: Java

import java.util.Scanner;

public class colon {
	public static void main(String[] args) {
	      Scanner scan = new Scanner(System.in);
	      String n = scan.next();
	      String[] data =n.split(",");
	      System.out.println(data[0]+" "+data[1]);
	      double a = Double.parseDouble(data[0]);
	      double b = Double.parseDouble(data[1]);
	      double h = Double.parseDouble(data[2]);
	      double m = Double.parseDouble(data[3]);
	      double tyou =h*30;
	      double tan = m*6;
	      double kaku;
	      if(tyou>=180) {
	    	  tyou=tyou-180;
	      }
	      if(tan>=180) {
	    	  tan=tan-180;
	      }
	      if(tyou>=tan) {
	    	  kaku = tyou-tan;
	      }else {
	    	  kaku = tan-tyou;
	      }
	      double cosa = Math.cos(Math.toRadians(kaku));
	      double an = a*a+b*b-2*a*b*cosa;
	      double ans =Math.sqrt(an);
	      System.out.println(ans);
	}
}


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

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

int main(){
  static const double pi = 3.141592653589793;
  int A,B,H,M;
  cin >> A >> B >> H >> M;

  long double x = pi * 2 * ((long double)H / 12.0 + ((long double)M / 60.0) / 12.0 - (long
double)M / 60.0);

  long double cos;

  long double rsq = (long double)(A * A + B * B) - (long double)(2 * A * B) * cos(x);

  cout << rsq << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:82: error: 'cos' cannot be used as a function
   15 |   long double rsq = (long double)(A * A + B * B) - (long double)(2 * A * B) * cos(x);
      |                                                                               ~~~^~~
Language: C++

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

int main(){
  static const double pi = 3.141592653589793;
  int A,B,H,M;
  cin >> A >> B >> H >> M;

  long double x = pi * 2 * ((long double)H / 12.0 + ((long double)M / 60.0) / 12.0 - (long
double)M / 60.0);

  long double cos(x);

  long double rsq = (long double)(A * A + B * B) - (long double)(2 * A * B) * cos(x);

  cout << rsq << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:82: error: 'cos' cannot be used as a function
   15 |   long double rsq = (long double)(A * A + B * B) - (long double)(2 * A * B) * cos(x);
      |                                                                               ~~~^~~
Language: C++

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

int main(){
  static const double pi = 3.141592653589793;
  int A,B,H,M;
  cin >> A >> B >> H >> M;

  long double x = pi * 2 * ((long double)H / 12.0 + ((long double)M / 60.0) / 12.0 - (long
double)M / 60.0);

  long double cos(long double x);

  long double rsq = (long double)(A * A + B * B) - (long double)(2 * A * B) * cos(x);

  cout << rsq << endl;
}

Compiler output:
/usr/bin/ld: /tmp/cckNVqaO.o: in function `main':
a.cc:(.text+0xd8): undefined reference to `cos(long double)'
collect2: error: ld returned 1 exit status
Language: C++

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

int main(){
  static const double pi = 3.14159265358979323846264338327950;
  int A,B,H,M;
  cin >> A >> B >> H >> M;

  long double x = = PI * 2 * (11 (long double)H / 12.0 + ((long double)M / 60.0) / 12.0 - (long
double)M / 60.0);

  long double cos(long double x);

  long double rsq = (long double)(A * A + B * B) - (long double)(2 * A * B) * cos(x);

  cout << rsq <<else;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: expected primary-expression before '=' token
   10 |   long double x = = PI * 2 * (11 (long double)H / 12.0 + ((long double)M / 60.0) / 12.0 - (long
      |                   ^
a.cc:10:21: error: 'PI' was not declared in this scope; did you mean 'pi'?
   10 |   long double x = = PI * 2 * (11 (long double)H / 12.0 + ((long double)M / 60.0) / 12.0 - (long
      |                     ^~
      |                     pi
a.cc:10:35: error: expected primary-expression before 'long'
   10 |   long double x = = PI * 2 * (11 (long double)H / 12.0 + ((long double)M / 60.0) / 12.0 - (long
      |                                   ^~~~
a.cc:10:46: error: expression cannot be used as a function
   10 |   long double x = = PI * 2 * (11 (long double)H / 12.0 + ((long double)M / 60.0) / 12.0 - (long
      |                                              ^
a.cc:10:47: error: expected ')' before 'H'
   10 |   long double x = = PI * 2 * (11 (long double)H / 12.0 + ((long double)M / 60.0) / 12.0 - (long
      |                              ~                ^
      |                                               )
a.cc:17:17: error: expected primary-expression before 'else'
   17 |   cout << rsq <<else;
      |                 ^~~~
Language: C++

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

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

	double k = abs(h*30+(double)(m/2)-m*6));
	k = min(k,360-k);
	double pi = acos(-1.0);
	cout<<fixed<<setprecision(15)<<sqrt(abs(a*a+b*b-a*b*2*cos(k/180.0*pi)));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:47: error: expected ',' or ';' before ')' token
    9 |         double k = abs(h*30+(double)(m/2)-m*6));
      |                                               ^
Language: C++


#define PI #include<bits/stdc++.h>
using namespace std;
#define PI  3.14159265358979323846264338327950L

    
int main(){
  int a,b,h,m;
  cin>>a>>b>>h>>m;
  long double ha=(h/12)*2*PI+6*m;
  long double ma=(m/60)*2*PI;
  long double ans=a*a+b*b-2*a*b*cos(abs(ha-ma));
  cout<<ans;
}
    

Compiler output:
a.cc:4:9: warning: "PI" redefined
    4 | #define PI  3.14159265358979323846264338327950L
      |         ^~
a.cc:2:9: note: this is the location of the previous definition
    2 | #define PI #include<bits/stdc++.h>
      |         ^~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin>>a>>b>>h>>m;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:12:37: error: 'abs' was not declared in this scope; did you mean 'ans'?
   12 |   long double ans=a*a+b*b-2*a*b*cos(abs(ha-ma));
      |                                     ^~~
      |                                     ans
a.cc:12:33: error: 'cos' was not declared in this scope
   12 |   long double ans=a*a+b*b-2*a*b*cos(abs(ha-ma));
      |                                 ^~~
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout<<ans;
      |   ^~~~
a.cc:13:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define PI #include<bits/stdc++.h>
using namespace std;
#define PI 3.1415
int main(){
  int a,b,h,m;
  cin>>a>>b>>h>>m;
  double ha=(h/12)*2*PI;
  double ma=(m/60)*2*PI;
  double ans=a*a+b*b-2*a*b*cos(abs(ha-ma));
  cout<<ans;
}
    
int main(){
  int a,b,h,m;
  cin>>a>>b>>h>>m;
  long double ha=(h/12)*2*PI;
  long double ma=(m/60)*2*PI;
  long double ans=a*a+b*b-2*a*b*cos(abs(ha-ma));
  cout<<ans;
}
    

Compiler output:
a.cc:5:9: warning: "PI" redefined
    5 | #define PI 3.1415
      |         ^~
a.cc:3:9: note: this is the location of the previous definition
    3 | #define PI #include<bits/stdc++.h>
      |         ^~
a.cc:15:5: error: redefinition of 'int main()'
   15 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define PI 3.1415
int main(){
  int a,b,h,m;
  cin>>a>>b>>h>>m;
  double ha=(h/12)*2*PI;
  double ma=(m/60)*2*PI;
  double ans=a*a+b*b-2*a*b*cos(abs(ha-m1));
  cout<<ans;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:39: error: 'm1' was not declared in this scope; did you mean 'ma'?
    9 |   double ans=a*a+b*b-2*a*b*cos(abs(ha-m1));
      |                                       ^~
      |                                       ma
Language: C++

#include<bits/stdc++.h>
using namespace std;
#def PI 3.1415
int main(){
  int a,b,h,m;
  cin>>a>>b>>h>>m;
  double ha=(h/12)*2*PI;
  double ma=(m/60)*2*PI;
  double ans=a*a+b*b-2*a*b*cos(abs(ha-m1));
  cout<<ans;
}
    

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #def; did you mean #ifdef?
    3 | #def PI 3.1415
      |  ^~~
      |  ifdef
a.cc: In function 'int main()':
a.cc:7:22: error: 'PI' was not declared in this scope
    7 |   double ha=(h/12)*2*PI;
      |                      ^~
a.cc:9:39: error: 'm1' was not declared in this scope; did you mean 'ma'?
    9 |   double ans=a*a+b*b-2*a*b*cos(abs(ha-m1));
      |                                       ^~
      |                                       ma
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
const double PI=3.1415926535897932;
 
int main(){
 double a, b, h, m, c, a_pow, b_pow, ang_difuse;
 cin >>a>>b>>h>>m; 
 double long_ang = PI*(h/12);
 double short_ang = PI*(m/60);
 double ang_dif = abs(long_ang-short_ang); 
 if(ang_dif =< PI/2){
   ang_difuse = ang_dif;
 }else{
   ang_difuse = PI - ang_dif;
 }
 a_pow = pow(a, 2);
 b_pow = pow(b, 2); 
 c = sqrt(a_pow+b_pow-2*a*b*cos(ang_difuse));
 cout << c << endl;  
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: expected primary-expression before '<' token
   12 |  if(ang_dif =< PI/2){
      |              ^
Language: C++

#include <iostream>
using namespace std;
const double PI=3.1415926535897932;

int main(){
 double a, b, h, m, c, a_pow, b_pow;
 cin >>a>>b>>h>>m; 
 double long_ang = PI*(h/12);
 double short_ang = PI*(m/60);
 double ang_dif = abs(long_ang-short_ang); 
 a_pow = pow(a, 2);
 b_pow = pow(b, 2); 
 c = sqrt(a_pow+b_pow-2*a*b*cos(ang_dif));
 cout << c << endl;       
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'pow' was not declared in this scope; did you mean 'b_pow'?
   11 |  a_pow = pow(a, 2);
      |          ^~~
      |          b_pow
a.cc:13:29: error: 'cos' was not declared in this scope
   13 |  c = sqrt(a_pow+b_pow-2*a*b*cos(ang_dif));
      |                             ^~~
a.cc:13:6: error: 'sqrt' was not declared in this scope
   13 |  c = sqrt(a_pow+b_pow-2*a*b*cos(ang_dif));
      |      ^~~~
Language: C++

#include <iostream>
using namespace std;
const double PI=3.1415926535897932;

int main(){
 int a, b, h, m;
 double c;
 cin >>a>>b>>h>>m; 
 double long_ang = PI*(h/12);
 double short_ang = PI*(m/60);
 double ang_dif = abs(long_ang-short_ang); 
 c = sqrt(a**2+b**2-2*a*b*cos(ang_dif);
 cout << c;       
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: invalid type argument of unary '*' (have 'int')
   12 |  c = sqrt(a**2+b**2-2*a*b*cos(ang_dif);
      |             ^~
a.cc:12:18: error: invalid type argument of unary '*' (have 'int')
   12 |  c = sqrt(a**2+b**2-2*a*b*cos(ang_dif);
      |                  ^~
a.cc:12:27: error: 'cos' was not declared in this scope
   12 |  c = sqrt(a**2+b**2-2*a*b*cos(ang_dif);
      |                           ^~~
Language: C++

#include <iostream>
#include <corecrt_math_defines.h>
using namespace std;

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

    double hx, hy, mx, my, dist;

    hx = sin(2 * M_PI * ((double)h / 12 + (double)m / 60 / 12)) * a;
    hy = cos(2 * M_PI * ((double)h / 12 + (double)m / 60 / 12)) * a;
    mx = sin(2 * M_PI * m / 60) * b;
    my = cos(2 * M_PI * m / 60) * b;

    dist = sqrt(pow(hx - mx, 2) + pow(hy - my, 2));

    cout.precision(12);
    cout << showpoint << dist;

    return 0;
}

Compiler output:
a.cc:2:10: fatal error: corecrt_math_defines.h: No such file or directory
    2 | #include <corecrt_math_defines.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 << fixed << setprecision(9);
  float c=H*30+0.5*M-6*M;
  float pi=3.141592653589;
  float s=cos(c*2*pi/360);
  float l=a*a+b*b-2*a*b*s;
  float ans=l.sqrt();
  cout<<ans<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'H' was not declared in this scope
    9 |   float c=H*30+0.5*M-6*M;
      |           ^
a.cc:9:20: error: 'M' was not declared in this scope
    9 |   float c=H*30+0.5*M-6*M;
      |                    ^
a.cc:13:15: error: request for member 'sqrt' in 'l', which is of non-class type 'float'
   13 |   float ans=l.sqrt();
      |               ^~~~
Language: C

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

int main(){
  int a,b,h,m;
  double d;
  scanf("%d %d %d %d",&a,&b,&h,&m);
  sitah=30*h;
  sitam=6*m;
  d=a^2+b^2-a*b*cos(sitah-sitam);
  printf("%lf",d);
}
  

Compiler output:
main.c: In function 'main':
main.c:8:3: error: 'sitah' undeclared (first use in this function)
    8 |   sitah=30*h;
      |   ^~~~~
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:3: error: 'sitam' undeclared (first use in this function); did you mean 'signgam'?
    9 |   sitam=6*m;
      |   ^~~~~
      |   signgam
Language: C++

#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using lond = long double;
lond pi(void) {
 return atan(1.0) * 4.0;
}
#define PI 3.14159265358979323846264338327950L
//const double PI = acos(-1);
int main(){
	lond A,B,H,M;
	cin >> A >> B >> H >> M;
	lond ans;
	lond d_h,d_m;//lint
	d_h = (lond)(H * 60 + M) * 0.5;
	//d_h = (lond)(H * 60 + M)/720 * 360;//上のと一緒
	//d_h = (lond)(H * 60 + M)/720 * 2*PI;
	d_m = M * 6;
	//d_m = M/60 * 360;
	//d_m = M/60 * 2*PI;
	if (d_h >= 360)
		d_h = (lond)(d_h % 360);
	if (d_m >= 360)
		d_m = (lond)(d_m % 360);

	lond d_a = abs(d_h - d_m);//シータ
	// if (d_a > 18 0)
	// 	d_a = 360 - d_a;
	//cout << d_a << endl;
	lond rad = d_a * PI/180;
	cout << fixed << setprecision(20);
	ans = sqrt((lond)(B*B + A*A) - (lond)(2*A*B)*cos(rad));//度数からラジアンにしてcosに入れる
	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:34: error: invalid operands of types 'lond' {aka 'long double'} and 'int' to binary 'operator%'
   22 |                 d_h = (lond)(d_h % 360);
      |                              ~~~ ^ ~~~
      |                              |     |
      |                              |     int
      |                              lond {aka long double}
a.cc:24:34: error: invalid operands of types 'lond' {aka 'long double'} and 'int' to binary 'operator%'
   24 |                 d_m = (lond)(d_m % 360);
      |                              ~~~ ^ ~~~
      |                              |     |
      |                              |     int
      |                              lond {aka long double}
Language: C++

#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);

int main(){
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  double x, y, ra, rb, r;
  ra = (2 * pi * (H * 60 + M)) / (12 * 60);
  rb = (2 * pi * M) / 60;
  r = abs(rb - ra);
  y = B*sin(r);
  x = abs(A - (B*cos(r)));
  double ans = sqrt(x*x + y*y);
  cout << fixed << setprecision(15)　<< ans << endl;
  return 0;
}


Compiler output:
a.cc:15:36: error: extended character 　 is not valid in an identifier
   15 |   cout << fixed << setprecision(15)　<< ans << endl;
      |                                    ^
a.cc: In function 'int main()':
a.cc:15:36: error: expected ';' before '\U00003000'
   15 |   cout << fixed << setprecision(15)　<< ans << endl;
      |                                    ^~
      |                                    ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  double A,B,H,M;
  cin >> A >> B >> H >> M;
  double harsh;
  double difradi=0.0;
  double ans=0.0;
  
  harsh = abs(30*(H+M/60)-M*6);
  if(dif>180) dif = 360-dif;
  difradi = harsh*M_PI/180;
  //cout << dif << endl;
  //cout << difradi << endl;
  ans = sqrt(A*A+B*B-2*A*B*cos(difradi));
  cout << setprecision(20) << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:6: error: 'dif' was not declared in this scope; did you mean 'div'?
   12 |   if(dif>180) dif = 360-dif;
      |      ^~~
      |      div
Language: C++

#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
float PI = 3.14159265359;

int main(void) {

	long float a, b, h, m;
	
	cin >> a >> b >> h >> m;

	long float l_x, l_y, s_x, s_y;

	l_x = a * cos((m / 30)*PI);
	l_y = a * sin((m / 30)*PI);

	s_x = b * cos(((m + 60*h) / 360)*PI);
	s_y = b * sin(((m + 60 * h)/360)*PI);

	long float lon;

	lon = sqrt((pow(l_x-s_x,2))+ (pow(l_y - s_y, 2)));

	printf("%.10f",lon);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'long' specified with 'float'
   10 |         long float a, b, h, m;
      |         ^~~~
a.cc:10:9: error: 'long' specified with 'float'
a.cc:10:9: error: 'long' specified with 'float'
a.cc:10:9: error: 'long' specified with 'float'
a.cc:14:9: error: 'long' specified with 'float'
   14 |         long float l_x, l_y, s_x, s_y;
      |         ^~~~
a.cc:14:9: error: 'long' specified with 'float'
a.cc:14:9: error: 'long' specified with 'float'
a.cc:14:9: error: 'long' specified with 'float'
a.cc:22:9: error: 'long' specified with 'float'
   22 |         long float lon;
      |         ^~~~
Language: C++

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

int main(){
  int main(){
   double a,b,h,m;
   cin>>a>>b>>h>>m;
   double s=h*30+0.5*m;
   double g=m*6;
   double x=(max(s,g)-min(s,g))*3.14159265358979/180;
    // Your code here!
   cout<<fixed<<setprecision(18)<<sqrt(a*a+b*b-2*a*b*cos(x)) <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    5 |   int main(){
      |           ^~
a.cc:5:11: note: remove parentheses to default-initialize a variable
    5 |   int main(){
      |           ^~
      |           --
a.cc:5:11: note: or replace parentheses with braces to value-initialize a variable
a.cc:5:13: error: a function-definition is not allowed here before '{' token
    5 |   int main(){
      |             ^
a.cc:13:2: error: expected '}' at end of input
   13 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

/*BISMILLAH
THE WHITE WOLF
NO DREAM IS TOO BIG AND NO DREAMER IS TOO SMALL*/

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

#define io ios_base::sync_with_stdio(false)
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vll vector<long long>
#define pb push_back
#define mod 100000007
#define pii pair<int, int>
#define PI 2*acos(0.0)

double a, b, h, m;

int main()
{
    io;
    cin>> a>>b>>h >>m;
    h += m/60;
    double ma = PI/30*m, ha = PI/6*h;
    double ang = ha - ma;3 4 10 403 4 10 40
    double ans = sqrt(a*a + b*b - 2*a*b*cos(ang));
    printf("%.15f", ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:27: error: expected ';' before numeric constant
   26 |     double ang = ha - ma;3 4 10 403 4 10 40
      |                           ^~
      |                           ;
a.cc:28:21: error: 'ans' was not declared in this scope; did you mean 'ang'?
   28 |     printf("%.15f", ans);
      |                     ^~~
      |                     ang
Language: C++

#include <stdio.h>
2 #include <math.h>
3
4 #define PI 3.14159265358979323846264338327950L
5
6 int main(void) {
7 int a, b, h, m;
8 scanf("%d%d%d%d", &a, &b, &h, &m);
9
10 long double rad = PI * 2 * (
11 (long double)h / 12.0 + ((long double)m / 60.0) / 12.0 - (long
double)m / 60.0);
12
13 long double rsq = (long double)(a * a + b * b) - (long double)(2 * a *
b) * cosl(rad);
14
15 printf("%20.20Lf\n", sqrtl(rsq));
16
17 return 0;
18 }


Compiler output:
a.cc:2:3: error: stray '#' in program
    2 | 2 #include <math.h>
      |   ^
a.cc:4:3: error: stray '#' in program
    4 | 4 #define PI 3.14159265358979323846264338327950L
      |   ^
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2 #include <math.h>
      | ^
Language: C++

#define PI 3.14159265358979323846264338327950L
5
6 int main(void) {
7 int a, b, h, m;
8 scanf("%d%d%d%d", &a, &b, &h, &m);
9
10 long double rad = PI * 2 * (
11 (long double)h / 12.0 + ((long double)m / 60.0) / 12.0 - (long
double)m / 60.0);
12
13 long double rsq = (long double)(a * a + b * b) - (long double)(2 * a *
b) * cosl(rad);
14
15 printf("%20.20Lf\n", sqrtl(rsq));
16
17 return 0;


Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 5
      | ^
Language: C

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

#define PI 3.14159265358979323846264338327950L

int A, B, H, M;
long double res;

int main()
{
    cin >> A >> B >> H >> M;

    res = sqrt(A * A + B * B - 2 * A * B * cos(abs((H * 30 + M * 0.5) - (M * 6)) * PI / 180));
    cout  << res << endl;

    return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan =new Scanner(System.in);
		int A=new Integer(scan.next());
		int B=new Integer(scan.next());
		int H=new Integer(scan.next());
		int M=new Integer(scan.next());
		double shor=(H*60+M)*360/(12*60);
		double lon=6*M;
		double rad=shor-lon;
		if(lon<shor)
			rad=360-rad;
		double s=(A*A)+(B*B)-(2*A*B*Math.cos(Math.toRadians(rad)));
		System.out.println(Math.sqrt(s));
	}

}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
java.util.Scanner;
^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define PI 3.14159265358979

int main(){
    double a, b, h, m;
    cin >> a >> b >> h >> m;
    int elapsed = 60*h + m;
    double hh = 0.5*elapsed;
    double mm = (6*elapsed)%360;
    double alpha = abs(hh-mm);
    if(alpha > 180)
        alpha -= 180;
    double c = sqrt(a*a + b*b - 2*a*b*(cos(alpha*PI/180.0)));
    printf("%.10f", c);
    

Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: expected '}' at end of input
   17 |     printf("%.10f", c);
      |                        ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: Java

              import java.util.Scanner;     
            public static void main(String[] args){
                    	Scanner scan  = new Scanner(System.in);
              			double Pai = 3.141592653589793238462643383279;
                      	double a = scan.nextInt();
                      	double b = scan.nextInt();
                      	double h = scan.nextInt();
                      	double m = scan.nextInt();
                      
                      	double rad = Pai*2*(h/12.0 + (60.0/m)/12.0 - m/60.0);
                      
                      	double rpe = (a*a + b*b) - (2*a*b)*Math.cos(rad);
                      	 
                      	System.out.println(rpe);
                      
                    }
                    

Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
            public static void main(String[] args){
                          ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

          import java.util.Scanner;     
        public static void main(String[] args){
                	Scanner scan  = new Scanner(System.in);
          			double Pai = 3.141592653589793238462643383279;
                  	double a = scan.nextInt();
                  	double b = scan.nextInt();
                  	double h = scan.nextInt();
                  	double m = scan.nextInt();
                  
                  	double rad = Pai*2*(h/12.0 + (60.0/m)/12.0 - m/60.0);
                  
                  	double rpe = (a*a + b*b) - (2*a*b)*Math.cos(rad);
                  	 
                  	System.out.println(rpe);
                  
                }
                }

Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
        public static void main(String[] args){
                      ^
  (use --enable-preview to enable unnamed classes)
Main.java:17: error: class, interface, enum, or record expected
                }
                ^
2 errors
Language: Java

      import java.util.Scanner;     
    public static void main(String[] args){
            	Scanner scan  = new Scanner(System.in);
      			double Pai = 3.141592653589793238462643383279;
              	double a = scan.nextInt();
              	double b = scan.nextInt();
              	double h = scan.nextInt();
              	double m = scan.nextInt();
              
              	double rad = Pai*2*(h/12.0 + (60.0/m)/12.0 - m/60.0);
              
              	double rpe = (a*a + b*b) - (2*a*b)*Math.cos(rad);
              	 
              	System.out.println(rpe);
              
            }
            }

Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
    public static void main(String[] args){
                  ^
  (use --enable-preview to enable unnamed classes)
Main.java:17: error: class, interface, enum, or record expected
            }
            ^
2 errors
Language: Java

  import java.util.Scanner;     
public static void main(String[] args){
        	Scanner scan  = new Scanner(System.in);
  			double Pai = 3.141592653589793238462643383279L;
          	double a = scan.nextInt();
          	double b = scan.nextInt();
          	double h = scan.nextInt();
          	double m = scan.nextInt();
          
          	double rad = Pai*2*((h/12.0) + ((60.0/m)/12.0) - m/60.0);
          
          	double rpe = (a*a + b*b) - (2*a*b)*Math.cos(rad);
          	 
          	System.out.println(rpe);
          
        }
        }

Compiler output:
Main.java:4: error: not a statement
  			double Pai = 3.141592653589793238462643383279L;
  			                                             ^
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args){
              ^
  (use --enable-preview to enable unnamed classes)
Main.java:17: error: class, interface, enum, or record expected
        }
        ^
3 errors
Language: Java

    import java.util.Scanner;
    public class Main{
    public static void main(String[] args){
    	Scanner scan  = new Scanner(System.in);
      	double a = scan.nextInt();
      	double b = scan.nextInt();
      	double h = scan.nextInt();
      	double m = scan.nextInt();
      
      	double rad = (h/12 + (60/m)/12) - (m/60.0);
      
      	double rpe = (a*a + b*b) - (2*a*b)*cosl(rad);
      	 
      	System.out.println(rpe);
      
    }
    }

Compiler output:
Main.java:12: error: cannot find symbol
      	double rpe = (a*a + b*b) - (2*a*b)*cosl(rad);
      	                                   ^
  symbol:   method cosl(double)
  location: class Main
1 error
Language: Java

import java.util.Scanner;
public class Main{
public static void main(String[] args){
	Scanner scan  = new Scanner(System.in);
  	int a = scan.nextInt();
  	int b = scan.nextInt();
  	int h = scan.nextInt();
  	int m = scan.nextInt();
  
  	long double rad = (h/12 + (60/m)/12) - (m/60.0);
  
  	long double rpe = (a*a + b*b) - (2*a*b)*cosl(rad);
  	 
  	System.out.println(rpe);
  
}
}

Compiler output:
Main.java:10: error: not a statement
  	long double rad = (h/12 + (60/m)/12) - (m/60.0);
  	^
Main.java:10: error: ';' expected
  	long double rad = (h/12 + (60/m)/12) - (m/60.0);
  	    ^
Main.java:12: error: not a statement
  	long double rpe = (a*a + b*b) - (2*a*b)*cosl(rad);
  	^
Main.java:12: error: ';' expected
  	long double rpe = (a*a + b*b) - (2*a*b)*cosl(rad);
  	    ^
4 errors
Language: C++

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

int main(){
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  double x, y, ra, rb;
  double a1, a2, b1, b2;
  ra = 2 * pi * (H * 60 + M) / 12 * 60;
  rb = 2 * pi * M / 12;
  a1 = A * sin(ra + (pi / 2));
  a2 = A * cos(ra);
  b1 = B * sin(rb + (pi / 2));
  b2 = B * cos(rb);
  x = a1 - b1;
  y = a2 - b2;
  double ans = sqrt(x*x + y*y);
  count << ans << endl;
}
  
  /*
  r = double(2 * pi * ((H * 60) + M + ((60 - M) * 12)) / (12 * 60));
  x = sqrt(double(pow(A, 2) + pow(B, 2) - 2 * A * B * cos(r)));
  //printf("%.10f/n", x);
  */
  cout << x << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: invalid operands of types '<unresolved overloaded function type>' and 'double' to binary 'operator<<'
   19 |   count << ans << endl;
      |   ~~~~~~^~~~~~
a.cc: At global scope:
a.cc:27:3: error: 'cout' does not name a type
   27 |   cout << x << endl;
      |   ^~~~
a.cc:28:3: error: expected unqualified-id before 'return'
   28 |   return 0;
      |   ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

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

int main(){
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  double x, r;
  r = double(2 * pi * ((H * 60) + M + ((60 - M) * 12)) / (12 * 60));
  x = sqrt(double(pow(A, 2) + pow(B, 2) - 2 * A * B * cos(r)));
  printf("%.10f/n", x)
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected ';' before 'return'
   11 |   printf("%.10f/n", x)
      |                       ^
      |                       ;
   12 |   return 0;
      |   ~~~~~~
Language: C++

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

int main(){
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  float x, r;
  r = 2 * pi * ((H * 60) + M + ((60 - M) * 12)) / (12 * 60);
  x = sqrt(float(pow(A, 2) + pow(B, 2) - 2 * A * B * abs(cos(r))));
  printf("%.10f/n", x)
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected ';' before 'return'
   11 |   printf("%.10f/n", x)
      |                       ^
      |                       ;
   12 |   return 0;
      |   ~~~~~~
Language: C

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

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

/* Macros reg. ends here */

const ll INF = 1LL << 50;

static const long long mod = 1000000007;

int main() {
  // ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  double a, b, h, m;
  cin >> a >> b >> h >> m;

  auto deg = [](auto x) -> double { return x * M_PI / 180.0; };

  complex<double> zh = polar<double>(a, deg((60 * h + m) / 2.0));
  complex<double> zm = polar<double>(b, deg(m * 6.0));

  double ans = abs(zh - zm);
  cout << ans << endl;

  return 0;
}


Compiler output:
main.c:7:10: fatal error: algorithm: No such file or directory
    7 | #include <algorithm>
      |          ^~~~~~~~~~~
compilation terminated.
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);
    long double rad = M_PI * 2 * ((long double)h / 12.0 + ((long double)m / 60.0) / 12.0 - (long double)m / 60.0);
    long double rsq = (long double)(a * a + b * b) - (long double)(2 * a * b) * cosl(rad);
    printf("%20.20Lf\n", sqrtl(rsq));
    return 0;
}

Compiler output:
/usr/bin/ld: /tmp/cco2JDps.o: in function `main':
main.c:(.text+0xb6): undefined reference to `cosl'
/usr/bin/ld: main.c:(.text+0xd2): undefined reference to `sqrtl'
collect2: error: ld returned 1 exit status
Language: Java

/* C - :(Colon) */

import java.util.*;

private class Colon {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int A = scan.nextInt();
    int B = scan.nextInt();
    int H = scan.nextInt();
    int M = scan.nextInt();
    double arg1 = 30 * H + 0.5 * M;
    double arg2 = 6 * M;
    double x1 = A * Math.cos(Math.toRadians(arg1));
    double y1 = A * Math.sin(Math.toRadians(arg1));
    double x2 = B * Math.cos(Math.toRadians(arg2));
    double y2 = B * Math.sin(Math.toRadians(arg2));
    System.out.println(Math.hypot(x2 - x1, y2 - y1));
  }
}


Compiler output:
Main.java:5: error: modifier private not allowed here
private class Colon {
        ^
1 error
Language: Java

/* C - :(Colon) */

import java.util.*;

static class Colon {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int A = scan.nextInt();
    int B = scan.nextInt();
    int H = scan.nextInt();
    int M = scan.nextInt();
    double arg1 = 30 * H + 0.5 * M;
    double arg2 = 6 * M;
    double x1 = A * Math.cos(Math.toRadians(arg1));
    double y1 = A * Math.sin(Math.toRadians(arg1));
    double x2 = B * Math.cos(Math.toRadians(arg2));
    double y2 = B * Math.sin(Math.toRadians(arg2));
    System.out.println(Math.hypot(x2 - x1, y2 - y1));
  }
}


Compiler output:
Main.java:5: error: modifier static not allowed here
static class Colon {
       ^
1 error
Language: Java

/* C - :(Colon) */

import java.util.*;

public class Colon {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int A = scan.nextInt();
    int B = scan.nextInt();
    int H = scan.nextInt();
    int M = scan.nextInt();
    double arg1 = 30 * H + 0.5 * M;
    double arg2 = 6 * M;
    double x1 = A * Math.cos(Math.toRadians(arg1));
    double y1 = A * Math.sin(Math.toRadians(arg1));
    double x2 = B * Math.cos(Math.toRadians(arg2));
    double y2 = B * Math.sin(Math.toRadians(arg2));
    System.out.println(Math.hypot(x2 - x1, y2 - y1));
  }
}


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

#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265359
 
int main() {
  int A,B,H,M;
  double longrad,shortrad;
  double arc;
  double rad;
  
  cin >> A >> B >> H >> M;
  
  //長針角度
  longrad = 6*M;
  //短針角度
  shortrad = 30*H+0.5*M;
  //なす角
  if(longrad < shortrad){
    arc = shortrad - longrad;
  }else{
    arc = longrad - shortrad;
  }
  //ラジアン変換
  rad = arc * PI /180;
  
  //余弦定理
  long double syahen;
  long double square = long double(A*A+B*B);
  long double Ncos = long double(cos(rad));
  long double left = 2 * A * B * Ncos;
  syahen = sqrt(square - left);
  
  cout << syahen << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:24: error: expected primary-expression before 'long'
   28 |   long double square = long double(A*A+B*B);
      |                        ^~~~
a.cc:29:22: error: expected primary-expression before 'long'
   29 |   long double Ncos = long double(cos(rad));
      |                      ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  float a,b,h,m,res,theta;
  cin>>a>>b>>h>>m;
  theta = abs(h*30 - (min/5.00)*30);
  res = sqrt(a*a+b*b+2*a*b*cos(theta));
  cout<<res;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: invalid operands of types '<unresolved overloaded function type>' and 'double' to binary 'operator/'
    7 |   theta = abs(h*30 - (min/5.00)*30);
      |                       ~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  float a,b,h,m,res,theta;
  cin>>a>>b>>h>>m;
  theta = abs(h*30 - (min/5)*30);
  res = sqrt(a*a+b*b+2*a*b*cos(theta));
  cout<<res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator/'
    7 |   theta = abs(h*30 - (min/5)*30);
      |                       ~~~^~
Language: C++

#include<iostream>

using namespace std;

const double PI = acos(-1);

int main(){

    int a, b, h, m;
    cin >> a >> b >> h >> m;
    double th = double(h*60+m)/720 * 2*PI;
    double tm = double(m)/60 * 2*PI;
    double xh = a*cos(th), yh = a*sin(th);
    double xm = b*cos(tm), ym = b*sin(tm);
    double dx = xh-xm, dy = yh-ym;
    double ans = sqrt(dx*dx + dy*dy);
    printf("%.10f\n", ans);
    return 0;
}

Compiler output:
a.cc:5:19: error: 'acos' was not declared in this scope
    5 | const double PI = acos(-1);
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:13:19: error: 'cos' was not declared in this scope
   13 |     double xh = a*cos(th), yh = a*sin(th);
      |                   ^~~
a.cc:15:29: error: 'yh' was not declared in this scope; did you mean 'xh'?
   15 |     double dx = xh-xm, dy = yh-ym;
      |                             ^~
      |                             xh
a.cc:15:32: error: 'ym' was not declared in this scope; did you mean 'xm'?
   15 |     double dx = xh-xm, dy = yh-ym;
      |                                ^~
      |                                xm
a.cc:16:18: error: 'sqrt' was not declared in this scope
   16 |     double ans = sqrt(dx*dx + dy*dy);
      |                  ^~~~
Language: C++

#include <iostream>
#include <cmath>

#define PI 3.14159265
using namespace std;
int main(){
	float a, b, h, m;
  	cin >> a >> b >> h >> m;
  	float C = PI * 2 * (h/12 + (m/60)/12 - m/60);
  	float val = pow(a, 2) + pow(b, 2) - 2*a*b*cos(C);
  	#include <iostream>
#include <cmath>

#define PI 3.14159265
using namespace std;
int main(){
	float a, b, h, m;
  	cin >> a >> b >> h >> m;
  	float C = PI * 2 * (h/12 + (m/60)/12 - m/60);
  	float val = pow(a, 2) + pow(b, 2) - 2*a*b*cos(C);
  	printf("%20.20Lf\n", sqrtl(val));

}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   16 | int main(){
      |         ^~
a.cc:16:9: note: remove parentheses to default-initialize a variable
   16 | int main(){
      |         ^~
      |         --
a.cc:16:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:11: error: a function-definition is not allowed here before '{' token
   16 | int main(){
      |           ^
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <cmath>

#define PI 3.14159265
using namespace std;
int main(){
	float a, b, h, m;
  	cin >> a >> b >> h >> m;
  	float C = PI * 2 * (h/12 + (m/60)/12 - m/60);
  	float val = pow(a, 2) + pow(b, 2) - 2*a*b*cos(C);
  	#include <iostream>
#include <cmath>

#define PI 3.14159265
using namespace std;
int main(){
	float a, b, h, m;
  	cin >> a >> b >> h >> m;
  	float C = PI * 2 * (h/12 + (m/60)/12 - m/60);
  	float val = pow(a, 2) + pow(b, 2) - 2*a*b*cos(C);
  	printf("%20.20Lf\n", sqrtl(val));
}

}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   16 | int main(){
      |         ^~
a.cc:16:9: note: remove parentheses to default-initialize a variable
   16 | int main(){
      |         ^~
      |         --
a.cc:16:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:11: error: a function-definition is not allowed here before '{' token
   16 | int main(){
      |           ^
Language: C++

#include "pch.h"
#include<cmath>
#include <iostream>
#define _USE_MATH_DEFINES
#include<math.h>

using namespace std;

int main()
{
	int a, b, h, m;
	double alpha, beta, theta, c_2, c;

	cin >> a >> b >> h >> m;
	
	beta = m * 6;
	alpha = 30 * h + m * 0.5;
	if (alpha >= beta) {
		theta = alpha - beta;
		if (theta > 180) {
			theta = (360 - theta)*M_PI/180;
		}
		cout << theta << "\n" << cos(theta) << "\n";
		c_2 = a * a + b * b - 2 * a*b*cos(theta);
		cout << c_2 << "\n";
		c = sqrt(c_2);
	}
	else {
		theta = beta - alpha;
		if (theta > 180) {
			theta = (360 - theta)* M_PI/180;
		}
		cout << theta << "\n" << cos(theta) << "\n";
		c_2 = a * a + b * b - 2 * a*b*cos(theta);
		cout << c_2 << "\n";
		c = sqrt(c_2);
	}
	cout << c;

	return 0;
}

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C

import math
 
PI = math.pi
A, B, H, M = map(int, input().split())
 
arg_a = (float(H) + float(M)/60) / 12.0 * 360
arg_b = float(M) / 60.0 * 360
 
 
C = math.sqrt(A*A + B*B - 2*A*B* math.cos((arg_a-arg_b)/360*2*PI))
print(C)

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import math
      | ^~~~~~
main.c:3:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PI'
    3 | PI = math.pi
      | ^~
Language: C

#include<stdio.h>
#include<math.h>
int main(void){
int A,B,H,M,t;
double cos(double x);
double CC;
scanf("%d,%d,%d,%d\n",&A,&B,&H,&M);
    t = H * 60 + M;
    CC = pow(A,2.0) + pow(B,2.0) - 2*A*B*cos(11 * M_PI * t /360);
    printf("%f\n",pow(CC,0.5));
return 0;
}


Compiler output:
/usr/bin/ld: /tmp/ccXkTt3L.o: in function `main':
main.c:(.text+0x62): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0x8d): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0xe7): undefined reference to `cos'
/usr/bin/ld: main.c:(.text+0x118): undefined reference to `pow'
collect2: error: ld returned 1 exit status