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

#include<bits/stdc++.h>
int main(void){
  int n;
  int t,a;
  std::cin >> n >> t>>a;
  std::vector<int> h(n);
  std::vector<double> tem(n);
  for(int i = 0;i< n;i++){
    std::cin>>h[i];
  }
  double dis;
  int count = 0;
  for (int i = 0; i < n; i++) {
    tem[i]= t-(h[i]*0.006);
  }
  dis = abs(tem[0]-a);
  double = diff;
  for (size_t i = 1; i < n; i++) {
    diff = abs(tem[i]-a);
    if(dis>diff){
      dis = diff;
      count = i;
    }
  }
  std::cout<<count+1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: expected unqualified-id before '=' token
   17 |   double = diff;
      |          ^
a.cc:19:5: error: 'diff' was not declared in this scope
   19 |     diff = abs(tem[i]-a);
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(void)
{
int N,T,A;
int a[1000],ans=1;
cin>>N;
	int e=0;
cin>>T>>A;
long int H[1000];
for(int i=0;i<N;i++)
{
cin>>H[i];
	e=T-(H[i]*6/1000);
	oo[i]=A-e;
	if(oo[i]<0){oo[i]=-oo[i];}
if(oo[i]<oo[i-1]){ans=i+1;}
}
cout<<ans<<endl;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'oo' was not declared in this scope
   16 |         oo[i]=A-e;
      |         ^~
Language: C++

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

int main(){
	int n,t,a,i,j;
	double k,b;
	cin >>n;
	cin >>t >>a;
	int h[n];
	b=114514;
	for(i=0;i<n;i++){
		k=abs(a-t+0.006*h[i])
		if(k<b){
			b=k;
			j=i;
		}
	}
	cout<<i;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:38: error: expected ';' before 'if'
   13 |                 k=abs(a-t+0.006*h[i])
      |                                      ^
      |                                      ;
   14 |                 if(k<b){
      |                 ~~
Language: C++

#include<iostream>
#include<cstdlib>
 
int main()
{
	double n,t,a,h[1100],min = 100000000, minN = 0;
	std::cin >> n >> t >> a;
 
	for (int i = 0; i < n; i++)
	{
		std::cin >> h[i];
	}
 
	min = (a - (t - h[0] * 0.006));
	for (int i = 1; i <= n-1; i++)
	{
		if (min > std::fabs(a - (t - h[i] * 0.006)))
		{
			minN = i;
			std::cout << i;
		}
	}
 
	std::cout << minN + 1 << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: 'fabs' is not a member of 'std'; did you mean 'labs'?
   17 |                 if (min > std::fabs(a - (t - h[i] * 0.006)))
      |                                ^~~~
      |                                labs
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    try (Scanner sc = new Scanner(System.in)) {
      int N = sc.nextInt();
      int T = sc.nextInt();
      int A = sc.nextInt();
      int[] H = new int[N];
      for ( int j = 0; j < N; j++ ) {
        H[j] = sc.nextInt();
      }
      double h = (T-A)/0.006;
      double diff = Math.abs(H[0] - h);
      int answer = 1;
      if ( N > 1 ) {
        for ( int j = 1; j < N; j++ ) {
          int tempDiff = Math.abs(H[j] - h);
          if ( tempDiff < diff ) {
            diff = tempDiff;
            answer = j + 1;
          }
        }
      }
      System.out.println(answer);
    }
  }
}

Compiler output:
Main.java:18: error: incompatible types: possible lossy conversion from double to int
          int tempDiff = Math.abs(H[j] - h);
                                 ^
1 error
Language: C++

#include <iostream>
#include <algorithm>
#include <vector> 
#include <functional>
using namespace std;

int main(){
  int N,T,A;
 int H[1200];
  int dif[1200];
  cin>>N>>T>>A;
  std::vector<int> ans;
  for( int i=0;i<N;++i){
    cin>>H[i];
    dif[i]=A-T+H[i]*0,006;
    ans.push_back[dif[i]];
  }
 
   std::sort(ans.begin(),ans.end());
      
cout<<ans[0];
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   16 |     ans.push_back[dif[i]];
      |                  ^
Language: C++

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

int main () {
  int N, T, A;
  cin >> N >> T >> A;
  int M;
  int N;
  int MC;
  int NC;
  for ( int i = 0; i < N; i++) {
    int H;
    cin >> H;
    N = i;
    M = T - H * 0.006
      if ( i == 0 ) MC = M;
        else if ( | A - MC | > | A - M | ) {
          MC = M;
          NC = N;
        }
  }
  cout << NC << endl;
}
          
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: redeclaration of 'int N'
    8 |   int N;
      |       ^
a.cc:5:7: note: 'int N' previously declared here
    5 |   int N, T, A;
      |       ^
a.cc:15:22: error: expected ';' before 'if'
   15 |     M = T - H * 0.006
      |                      ^
      |                      ;
   16 |       if ( i == 0 ) MC = M;
      |       ~~              
a.cc:17:9: error: 'else' without a previous 'if'
   17 |         else if ( | A - MC | > | A - M | ) {
      |         ^~~~
a.cc:17:19: error: expected primary-expression before '|' token
   17 |         else if ( | A - MC | > | A - M | ) {
      |                   ^
a.cc:17:30: error: expected primary-expression before '>' token
   17 |         else if ( | A - MC | > | A - M | ) {
      |                              ^
a.cc:17:32: error: expected primary-expression before '|' token
   17 |         else if ( | A - MC | > | A - M | ) {
      |                                ^
a.cc:17:42: error: expected primary-expression before ')' token
   17 |         else if ( | A - MC | > | A - M | ) {
      |                                          ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){

	int N,T,A;
	cin>>N>>T>>A;
	std::vector<int>H(N);
	for(int i=0;i<N;i++)
		cin>>H[i];

	std::vector<int>ans(N);
	for(int i=0;i<N;i++){
		ans[i]=T*500-H[i]*3;
	}
	int y,z;
	y=abs(ans[0]-A*500);
	int anser=1;
	for(int i=1;i<N;i++){
		z=abs(ans[i]-A*500);
		if(z<y){
			y=z;
			anser=i+1;
		
	}
	cout<<anser<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C

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

int main() {
  int n, t, a, H[1000], num=1, i;
  double T1, T2;
  if(!scanf("%d", &n) exit(0);
  if(!scanf("%d%d", &t, &a)) exit(0);
  for(i=0; i < n; i++) {
    if(!scanf("%d", &H[i])) exit(0);
    if(!i) T1 = abs((double)a - ((double)t - ((double)H[i] * 0.006)));
    else {
      T2 = abs((double)a - ((double)t - ((double)H[i] * 0.006)));
      if(T1 > T2) {
        T1 = T2;
        num = i+1;
      }
    }
  }
  printf("%d\n", num);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:22: error: expected ')' before 'exit'
    7 |   if(!scanf("%d", &n) exit(0);
      |     ~                ^~~~~
      |                      )
main.c:22:1: error: expected expression before '}' token
   22 | }
      | ^
Language: C++

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

int main(){
	int n,t,a;
	cin >> n >> t >> a;
	vector<double> h(n),g(n),dif(n);
	for(int i=0;i<n;i++){
		cin >> h.at(i);
		g.at(i)=t-h.at(i)*0.006
		if(a-g.at(i)<0){
			dif.at(i)=g.at(i)-a;
		} else{
			dif.at(i)=a-g.at(i);
		}
	}
	int ans=0;
	for(int i=0;i<n;i++){
		if(dif.at(i)<dif.at(ans))
			ans=i;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:40: error: expected ';' before 'if'
   10 |                 g.at(i)=t-h.at(i)*0.006
      |                                        ^
      |                                        ;
   11 |                 if(a-g.at(i)<0){
      |                 ~~                      
a.cc:13:19: error: 'else' without a previous 'if'
   13 |                 } else{
      |                   ^~~~
Language: C++

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

int main() 
{
  int T,A;
  cin>>T>>A;
  for(int i=0;i<1000;i++)
  {
    vector<int>vec(i);
    cin>>vec(i);
     vector<int>s(i)=abs(A-( T-vec(i)*0.006)) ;
   int x=min(s(i),x);
  }
  cout<<s; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: no match for call to '(std::vector<int>) (int&)'
   12 |     cin>>vec(i);
      |          ~~~^~~
a.cc:13:21: error: expected ',' or ';' before '=' token
   13 |      vector<int>s(i)=abs(A-( T-vec(i)*0.006)) ;
      |                     ^
a.cc:14:15: error: no match for call to '(std::vector<int>) (int&)'
   14 |    int x=min(s(i),x);
      |              ~^~~
a.cc:16:9: error: 's' was not declared in this scope
   16 |   cout<<s;
      |         ^
Language: C++

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

int main(){
	int n,t,a;
	cin >> n >> t >> a;
	vector<double> h(n),g(n),dif(n);
	for(int i=0;i<n;i++){
		cin >> h.at(i);
		g.at(i)=t-h.at(i)*0.006
		if(a-g.at(i)<0){
			dif.at(i)=g.at(i)-a;
		} else{
			dif.at(i)=a-g.at(i);
		}
	}
	int ans=0;
	for(int i=0;i<n;i++){
		if(dif.at(i)<dif.at(ans))
			ans=i
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:40: error: expected ';' before 'if'
   10 |                 g.at(i)=t-h.at(i)*0.006
      |                                        ^
      |                                        ;
   11 |                 if(a-g.at(i)<0){
      |                 ~~                      
a.cc:13:19: error: 'else' without a previous 'if'
   13 |                 } else{
      |                   ^~~~
a.cc:20:30: error: expected ';' before '}' token
   20 |                         ans=i
      |                              ^
      |                              ;
   21 |         }
      |         ~
Language: C

#include<stdio.h>
int main(){
int n,t,a,h,h2,i,ta,tah,k;

scanf("%d %d %d",&n,&t,&a);
ta=t-a;
int i;
int min=t;

for(i=0;i<n;i++){

scanf("%d",&h2);
h=h2*0.006;

if(ta<h){
tah=h-ta;
}else{
tah=ta-h;
}

if(tah<min){
k=i+1;
min=tah;
}


}

printf("%d",k);
return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:5: error: redeclaration of 'i' with no linkage
    7 | int i;
      |     ^
main.c:3:16: note: previous declaration of 'i' with type 'int'
    3 | int n,t,a,h,h2,i,ta,tah,k;
      |                ^
Language: C++

int i, B;
	int U = 1000000;
	int H[1000];
	char M[1000];
	char K[1000];
	cin >> N >> T >> A;
	for (i = 0; i < N; ++i)cin >> H[i];
	for (i = 0; i < N; ++i)M[i] = T - H[i] * 0.006;
	for (i = 0; i < N; ++i)K[i] = abs(M[i] - A);
	for (i = 0; i < N; ++i) {
		if (K[i] < U) {
			U = K[i];
			B = i;
		}
	}
	cout << B + 1;
	return 0;
}

Compiler output:
a.cc:6:9: error: 'cin' does not name a type
    6 |         cin >> N >> T >> A;
      |         ^~~
a.cc:7:9: error: expected unqualified-id before 'for'
    7 |         for (i = 0; i < N; ++i)cin >> H[i];
      |         ^~~
a.cc:7:21: error: 'i' does not name a type
    7 |         for (i = 0; i < N; ++i)cin >> H[i];
      |                     ^
a.cc:7:28: error: expected unqualified-id before '++' token
    7 |         for (i = 0; i < N; ++i)cin >> H[i];
      |                            ^~
a.cc:8:9: error: expected unqualified-id before 'for'
    8 |         for (i = 0; i < N; ++i)M[i] = T - H[i] * 0.006;
      |         ^~~
a.cc:8:21: error: 'i' does not name a type
    8 |         for (i = 0; i < N; ++i)M[i] = T - H[i] * 0.006;
      |                     ^
a.cc:8:28: error: expected unqualified-id before '++' token
    8 |         for (i = 0; i < N; ++i)M[i] = T - H[i] * 0.006;
      |                            ^~
a.cc:9:9: error: expected unqualified-id before 'for'
    9 |         for (i = 0; i < N; ++i)K[i] = abs(M[i] - A);
      |         ^~~
a.cc:9:21: error: 'i' does not name a type
    9 |         for (i = 0; i < N; ++i)K[i] = abs(M[i] - A);
      |                     ^
a.cc:9:28: error: expected unqualified-id before '++' token
    9 |         for (i = 0; i < N; ++i)K[i] = abs(M[i] - A);
      |                            ^~
a.cc:10:9: error: expected unqualified-id before 'for'
   10 |         for (i = 0; i < N; ++i) {
      |         ^~~
a.cc:10:21: error: 'i' does not name a type
   10 |         for (i = 0; i < N; ++i) {
      |                     ^
a.cc:10:28: error: expected unqualified-id before '++' token
   10 |         for (i = 0; i < N; ++i) {
      |                            ^~
a.cc:16:9: error: 'cout' does not name a type
   16 |         cout << B + 1;
      |         ^~~~
a.cc:17:9: error: expected unqualified-id before 'return'
   17 |         return 0;
      |         ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include <stdio.h>
int main()
{
      int n, t, d, index, h;
      double tmp, s;
      int m=1000000;
      scanf("%d %d %d", &n,&t, &d);
      for(int i=1;i<=n;i++)
      {
            scanf("%d", &h);
            tmp=t-h*0.006 - d; 
            s= (tmp>)0) ? tmp:-tmp;
            if( s < m ) m=s, index=i;
       }
       printf("%d", index);
       return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: expected primary-expression before ')' token
   12 |             s= (tmp>)0) ? tmp:-tmp;
      |                     ^
Language: C++

#include<iostream>
#include<vector>
#include<cstdlib>

using namespace std;

int main(int argc, char **argv) {
    int n, t, a, ans;
    double diff;
    vector<double> h;

    cin >> n >> t >> a;

    for (int i = 0; i < n;i++) {
        int input;
        cin >> input;
        h.push_back(input);
        h[i] = t - h[i] * 0.006;
    }

    diff = fabs((double)a - h[0]);
    ans = 1;

    for (int j = 0; j < n; j++) {
        if (fabs((double)a - h[j]) < diff) {
            diff = fabs((double)a - h[j]);
            ans = j + 1;
        }
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:21:12: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   21 |     diff = fabs((double)a - h[0]);
      |            ^~~~
      |            labs
Language: C++

#include<iostream>
#include<vector>
#include<cstdlib>

using namespace std;

int main(int argc, char **argv) {
    int n, t, a, ans;
    double diff;
    vector<double> h;

    cin >> n >> t >> a;

    for (int i = 0; i < n;i++) {
        int input;
        cin >> input;
        h.push_back(input);
        h[i] = t - h[i] * 0.006;
    }

    diff = fabs((double)a - h[0]);
    ans = 1;

    for (int j = 0; j < n; j++) {
        if (abs((double)a - h[j]) < diff) {
            diff = abs((double)a - h[j]);
            ans = j + 1;
        }
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:21:12: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   21 |     diff = fabs((double)a - h[0]);
      |            ^~~~
      |            labs
Language: C++

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

int main() {
  int N, T, A;
  cin >> N >> T >> A;
  int x = 50;
  int i;
  while (i < N) {
    cin >> H;
    int y = A - (T - H * 0.006);
    int z = A - (H * 0.006 - T);
    if (z > y) {
      if (y > x) {
        x = y;
        i++;
      }
    }
    else if (y > z) {
      if (z > x) {
        x = z;
        i++;
      }
    }
    else {}
  }
  cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'H' was not declared in this scope
   10 |     cin >> H;
      |            ^
Language: C++

int main() {
	int N, T, A;
	int i, B;
	int U = 1000000;
	int H[1000];
	int M[1000];
	int K[1000];
	cin >> N >> T >> A;
	for (i = 0; i < N; ++i)cin >> H[i];
	for (i = 0; i < N; ++i)M[i] = T - H[i] * 0.006;
	for (i = 0; i < N; ++i)K[i] = abs(M[i] - A);
	for (i = 0; i < N; ++i) {
		if (K[i] < U) {
			U = K[i];
			B = i;
		}
	}
	cout << B + 1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> N >> T >> A;
      |         ^~~
a.cc:11:39: error: 'abs' was not declared in this scope
   11 |         for (i = 0; i < N; ++i)K[i] = abs(M[i] - A);
      |                                       ^~~
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << B + 1;
      |         ^~~~
Language: C++

#include <iostream>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <iomanip>
#include <fstream>
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = (1 << 30);
const ll inf = (1LL << 60LL);
const int maxn = 1e5 + 10;
int n;
double T,A;
double arr[maxn];
int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
//    ifstream cin("in.txt");
    cin >> n >> T >> A;
    for(int i =0 ;i < n; i ++){
        cin >>arr[i];
    }
    vector<pair<double, int> > v;
    for(int i =0 ; i < n; i ++){
        v.push_back(make_pair( (T - arr[i] * 0.06)) - A, i + 1));
    }
    sort(v.begin(), v.end());
    cout << v[0].second << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:32:30: error: no matching function for call to 'make_pair(double)'
   32 |         v.push_back(make_pair( (T - arr[i] * 0.06)) - A, i + 1));
      |                     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: candidate: 'template<class _T1, class _T2> constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&)'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1132:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

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

int main() {
  int N, T, A;
  cin >> N >> T >> A;
  int x = 50;
  while (i < N) {
    cin >> H;
    int y = A - (T - H * 0.006);
    int z = A - (H * 0.006 - T);
    if (z > y) {
      if (y > x) {
        x = y;
        i++;
      }
    }
    else if (y > z) {
      if (z > x) {
        x = z;
        i++;
      }
    }
    else {}
  }
  cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'i' was not declared in this scope
    8 |   while (i < N) {
      |          ^
a.cc:9:12: error: 'H' was not declared in this scope
    9 |     cin >> H;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>P;
int main(void){
	int n;
	int t,a;#include<bits/stdc++.h>
using namespace std;
int main(void){
	int n;
	int t,a;
	int h[1001];
	cin>>n;
	cin>>t>>a;
	for(int i=1;i<=n;i++){
		cin>>h[i];
	}
	int MIN;
	int x=INT_MAX;
	int y;
	int z;
	for(int i=1;i<=n;i++){
		MIN=t-h[i]*0.006;
		y=x;
		x=min(x,abs(MIN-a));
		if(x!=y) z=i;
	}
	cout<<z<<endl;
	return 0;
}
	int h[1001];
	P p[1001];
	cin>>n;
	cin>>t>>a;
	for(int i=1;i<=n;i++){
		cin>>h[i];
	}
	int MIN;
	int x=INT_MAX;
	for(int i=1;i<=n;i++){
		MIN=t-h[i]*0.006;
		if(h[i]*0.006＞0){
			p[i].first=(MIN-a);
		}else{
			p[i].first=abs(MIN-a);
		}
		p[i].second=i;
	}
	sort(p+1,p+n+1);
	cout<<p[1].second<<endl;
	return 0;
}

Compiler output:
a.cc:6:17: error: stray '#' in program
    6 |         int t,a;#include<bits/stdc++.h>
      |                 ^
a.cc: In function 'int main()':
a.cc:6:18: error: 'include' was not declared in this scope
    6 |         int t,a;#include<bits/stdc++.h>
      |                  ^~~~~~~
a.cc:6:26: error: 'bits' was not declared in this scope
    6 |         int t,a;#include<bits/stdc++.h>
      |                          ^~~~
a.cc:6:31: error: 'stdc' was not declared in this scope; did you mean 'std'?
    6 |         int t,a;#include<bits/stdc++.h>
      |                               ^~~~
      |                               std
a.cc:7:1: error: expected primary-expression before 'using'
    7 | using namespace std;
      | ^~~~~
a.cc:8:15: error: a function-definition is not allowed here before '{' token
    8 | int main(void){
      |               ^
a.cc:41:25: error: unable to find numeric literal operator 'operator""\U0000ff1e0'
   41 |                 if(h[i]*0.006＞0){
      |                         ^~~~~~~~
Language: C

#include<stdio.h>
#include <sysexits.h>
int main(void){
  int N,T,A,i,j,k;
  double temp=0.0;
  j=0;
  int H[N];
  if(scanf("%d",&N)!=1){
    exit(1);
  }
  if(scanf("%d%d",&T,&A)){
    exit(1);
  }
  for(i=0;i<N;i++){
  if(scanf,"%d",N[i]){
    exit(1);
  }
  }
  for(j=0;j<N:j++){
    if(temp<(T-N[j]*0.006)){
  temp=T-N[j]*0.006;
  k=j;
    }
  }
  printf("%d".k);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:9:5: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    9 |     exit(1);
      |     ^~~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
    2 | #include <sysexits.h>
  +++ |+#include <stdlib.h>
    3 | int main(void){
main.c:9:5: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    9 |     exit(1);
      |     ^~~~
main.c:9:5: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:12:5: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   12 |     exit(1);
      |     ^~~~
main.c:12:5: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:15:18: error: subscripted value is neither array nor pointer nor vector
   15 |   if(scanf,"%d",N[i]){
      |                  ^
main.c:16:5: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   16 |     exit(1);
      |     ^~~~
main.c:16:5: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:19:14: error: expected ';' before ':' token
   19 |   for(j=0;j<N:j++){
      |              ^
      |              ;
main.c:20:17: error: subscripted value is neither array nor pointer nor vector
   20 |     if(temp<(T-N[j]*0.006)){
      |                 ^
main.c:21:11: error: subscripted value is neither array nor pointer nor vector
   21 |   temp=T-N[j]*0.006;
      |           ^
main.c:25:14: error: request for member 'k' in something not a structure or union
   25 |   printf("%d".k);
      |              ^
Language: C++

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

int main(){
	int n,t,a,;
	cin >> n >> t >> a;
	vector<double> h(n),g(n),dif(n);
	for(int i=0;i<n;i++){
		cin >> h.at(i);
		g.at(i)=t-h.at(i)*0.006
		if(a-g.at(i)<0){
			dif.at(i)=g.at(i)-a;
		}
		else{
			dif.at(i)=a-g.at(i);
		}
	}
	ans=0;
	for(int i=0;i<n;i++){
		if(dif.at(i)<dif.at(ans))
			ans=i;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: expected unqualified-id before ';' token
    5 |         int n,t,a,;
      |                   ^
a.cc:10:40: error: expected ';' before 'if'
   10 |                 g.at(i)=t-h.at(i)*0.006
      |                                        ^
      |                                        ;
   11 |                 if(a-g.at(i)<0){
      |                 ~~                      
a.cc:14:17: error: 'else' without a previous 'if'
   14 |                 else{
      |                 ^~~~
a.cc:18:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |         ans=0;
      |         ^~~
      |         abs
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>

using namespace std;

const long long INF = 10000000;

int main(){
	double n,t,a;
	double h[1000],temp[1001];
	cin >> n >> t >> a;
	for (int i = 0; i < n; i++) {
	    cin >> h[i];
		temp[i] = abs(a - t + 0.006*h[i]);
		cout << temp[i] << endl;
	}
	double ans = INF;
	for (int i = 0; i < n; i++) {
	    if (temp[ans] > temp[i])
			ans = i + 1;
		cout << ans << endl;
	}
//	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: invalid types 'double [1001][double]' for array subscript
   21 |             if (temp[ans] > temp[i])
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int h[1005];
int main()
{
    int n,t,a;
    scanf("%d",&n);
    scanf("%d%d",&t,&a);
    for(int i=0;i<n;i++) scanf("%d",&h[i]);
    int ans;
    double p;
    for(int i=0;i<n;i++)
    {
        double k=t*1.0-h[i]*0.006;
        if(i==0)
        {
            p=abs(a-k);
            ans=i+1;
        }
        else
        {
            double pp=abs(a-k);
            if(pp<p)
            {
                ans=i+1;
                p=pp;
            }
        }
    }
    printf("%d\n",ans);
}
#include<bits/stdc++.h>
using namespace std;
int h[1005];
int main()
{
    int n,t,a;
    scanf("%d",&n);
    scanf("%d%d",&t,&a);
    for(int i=0;i<n;i++) scanf("%d",&h[i]);
    int ans;
    double p;
    for(int i=0;i<n;i++)
    {
        double k=t*1.0-h[i]*0.006;
        if(i==0)
        {
            p=abs(a-k);
            ans=i+1;
        }
        else
        {
            double pp=abs(a-k);
            if(pp<p)
            {
                ans=i+1;
                p=pp;
            }
        }
    }
    printf("%d\n",ans);
}

Compiler output:
a.cc:34:5: error: redefinition of 'int h [1005]'
   34 | int h[1005];
      |     ^
a.cc:3:5: note: 'int h [1005]' previously declared here
    3 | int h[1005];
      |     ^
a.cc:35:5: error: redefinition of 'int main()'
   35 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
Language: C++

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

int main() {
 int N,T,A;
 cin >> N >> T >> A;
 vector<int>H(N);
 for(int i=0;i<N;i++){
  cin >> H.at(i);
 }
  
 vector<int>temp(N);
 for(int i=0;i<N;i++){
   temp.at(i) = A - T - (H.at(i)*6/1000);
 }
 for(int i=0;i<N;i++){
  if(temp.at(i)<0){
    temp.at(i) = -temp.at(i);
 }
  
  sort(temp.begin(),temp.end());
  
 int answer =0;
 for(int i=0;i<N;i++){
  if(temp.at(0)==(A - T - (H.at(i)*6/1000))){
    answer = i;
    break;
   }
 }
  
 
 cout << answer+1 << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:2: error: expected '}' at end of input
   35 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n, t, a, ans = -1;
	double best = 1 << 20;
	cin >> n;
	cin >> t >> a;
	vector<int> h(n);
	for (auto&& hh : h) cin >> hh;
	for (int i = 0; i < n; ++i) {
		double tmp = -0.006 * h[i];
		if (fabs(t - tmp - a) < best) {
			ans = i + 1;
			best = fabs(t - tmp - a);
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   18 |                 if (fabs(t - tmp - a) < best) {
      |                     ^~~~
      |                     labs
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n, t, a, ans = -1;
	double best = 1 << 20;
	cin >> n;
	cin >> t >> a;
	vector<int> h(n);
	for (auto&& hh : h) cin >> hh;
	for (int i = 0; i < n; ++i) {
		double tmp = -0.006 * h[i];
		if (fabs(t - tmp - a) < best) {
			ans = i + 1;
			best = abs(t - tmp - a);
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   18 |                 if (fabs(t - tmp - a) < best) {
      |                     ^~~~
      |                     labs
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
signed main() {
	int n, t, a;
	pair<int, int> h[1000];
	cin >> n >> t >> a;
	for (int i = 0; i < n; i++) {
		cin >> h[i].first;
		h[i].second = i + 1;
	}
	sort(h, h + n);
	int ans, b=INT_MAX;
	for (int i = 0; i < n; i++) {
		if ((a - t + h[i].first * 6 / 1000) < b) {
			b = (a - t + h[i].first * 6 / 1000);
			ans = h[i].second;
		}
		else {
			cout << ans << endl;
			return 0;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: 'INT_MAX' was not declared in this scope
   13 |         int ans, b=INT_MAX;
      |                    ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>

using namespace std;

const long long INF = 10000000;

int main(){
	double n,t,a;
	double h[1000],temp[1001];
	cin >> n >> t >> a;
	for (int i = 0; i < n; i++) {
	    cin >> h[i];
		temp[i] = abs(a - t + 0.006*h[i]);
		cout << temp[i] << endl;
	}
	double ans = INF;
	for (int i = 0; i < n; i++) {
	    if (temp[ans] > temp[i])
			ans = i + 1;
		cout << ans << endl;
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: invalid types 'double [1001][double]' for array subscript
   21 |             if (temp[ans] > temp[i])
      |                     ^
Language: C++

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

int main() {
  int N, T, A;
  cin >> N >> T >> A;
  while (i < N) {
    int x = 50;//近似値
    cin >> H;
    int y = A - (T - H * 0.006);
    int z = A - (H * 0.006 - T);
    if (z > y) {
      if (y > x) {
        x = y;
        i++;
      }
    }
    else if (y > z) {
      if (z > x) {
        x = z;
        i++;
      }
    }
  }
  cout << z << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'i' was not declared in this scope
    7 |   while (i < N) {
      |          ^
a.cc:9:12: error: 'H' was not declared in this scope
    9 |     cin >> H;
      |            ^
a.cc:25:11: error: 'z' was not declared in this scope
   25 |   cout << z << endl;
      |           ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
 
int main(){
  int N,T,A,k,t=-1000.0,n;
  cin >> N >> T >> A;
  
  for(int i=1;i<=N;i++){
    cin >> k;
    if(absf(t) > absf(A-T-k*0.006)){
      t = A-T-k*0.006;
      n=i;
    }
  }
  cout << n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'absf' was not declared in this scope; did you mean 'fabsf'?
   11 |     if(absf(t) > absf(A-T-k*0.006)){
      |        ^~~~
      |        fabsf
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>P;
int main(void){
	int n;
	int t,a;
	int h[1001];
	P p[1001];
	cin>>n;
	cin>>t>>a;
	for(int i=1;i<=n;i++){
		cin>>h[i];
	}
	int MIN;
	int x=INT_MAX;
	for(int i=1;i<=n;i++){
		MIN=t-h[i]*0.006;
		if(h[i]*0.006＞0){
			p[i].first=(MIN-a);
		}else{
			p[i].first=abs(MIN-a);
		}
		p[i].second=i;
	}
	sort(p+1,p+n+1);
	cout<<p[1].second<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: unable to find numeric literal operator 'operator""\U0000ff1e0'
   18 |                 if(h[i]*0.006＞0){
      |                         ^~~~~~~~
Language: Java

static PrintWriter out; 

	static void solve()
	{
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int T = stdIn.nextInt();
		int A = stdIn.nextInt();
		int[] H = new int[N];
		for(int i = 0; i < N; i++)
		{
			H[i] = stdIn.nextInt();
		}
		int answer = 1;
		int near_A = (int)Math.abs(A - (T - (H[0] * 0.006)));
		for(int i = 1; i < N; i++)
		{
			System.out.println(near_A);
			System.out.println(i+" = "+Math.abs(A - (T - (H[i] * 0.006))));
			
			if(near_A > Math.abs(A - (T - (H[i] * 0.006))))
			{
				System.out.println("near_A = " + near_A);
				answer = i + 1;
				near_A = (int)Math.abs(A - (T - (H[i] * 0.006)));
			}
		}
		System.out.println(answer);
	}

	public static void main(String[] args) 
	{ 
		in = new Scanner(System.in); 
		out = new PrintWriter(System.out); 
		solve(); 
		out.flush(); 
		out.close(); 
		in.close(); 
	} 
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
static PrintWriter out; 
       ^
  (use --enable-preview to enable unnamed classes)
Main.java:40: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.util.*;
public class B_Place{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> ar = new ArrayList<Integer>();
    int N = sc.nextInt();
    int T = sc.nextInt();
    int A = sc.nextInt();
    int H[] = new int[N];
    for(int i=0;i<N;i++){
      H[i] = sc.nextInt();
    }
    if(N == 1){
      System.out.println(1);
    }else{
      double min = Math.abs((12 - H[0]*0.006) - A);
      for(int i=1;i<N;i++){
        if(Math.abs((12 - H[i]*0.006) - A)<min){
          min = Math.abs(12 - H[i]*0.006);
          ar.add(i);
        }
      }
    }
    if(ar.size() == 0){
      System.out.println(1);
    }else{
      System.out.println(ar.get(ar.size()-1)+1);
    }

  }
}


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

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

#define FOR(i, n) for(int i = 0; i < (n); i++)
#define FORq(i, m, n) for(int i = (m); i < (n); i++)
#define FORr(i, n) for (int i = (n); i >= 0; i++)

int main() {
	int N, T, A, num;
	float ans;
	cin >> N;
	cin >> T >> A;
	vector<int> H(N);
	FOR(i, N) {
		cin >> H[i];
	}
	ans = T - (H[0] * 0.006);
	num = 1;

	FORq(i, 1, N) {
		if (fabsf(T - (H[i] * 0.006) - A) < fabsf(ans - A)) {
			ans = T - (H[i] * 0.006);
			num = i + 1;
		}
	}

	cout << num << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: 'fabsf' was not declared in this scope
   24 |                 if (fabsf(T - (H[i] * 0.006) - A) < fabsf(ans - A)) {
      |                     ^~~~~
Language: C++

#include<iostream>
using namespace std;
 
int main(){
  int N,T,A,k,t=-1000.0,n;
  cin >> N >> T >> A;
  
  for(int i=1;i<=N;i++){
    cin >> k;
    if(absf(t) > absf(A-T-k*0.006)){
      t = A-T-k*0.006;
      n=i;
    }
  }
  cout << n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'absf' was not declared in this scope; did you mean 'abs'?
   10 |     if(absf(t) > absf(A-T-k*0.006)){
      |        ^~~~
      |        abs
Language: C++

#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
	int n, t, a, ans = -1;
	double min = -1;
	cin >> n >> t >> a;
	t -= a;
	int h[1000];
	for (int i = 0; i < n; i++) {
		cin >> h[i];
		if (fabs(h[i] * 0.006 - (double)t) < min || ans == -1) {
			min = abs(h[i] * 0.006 - t);
			ans = i;
		}
	}
	cout << ans + 1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   12 |                 if (fabs(h[i] * 0.006 - (double)t) < min || ans == -1) {
      |                     ^~~~
      |                     labs
Language: C++

#include <iostream>
#include <string>

using namespace std;

void LoopUtZeroIn() {
  int luziHoge = 10;
  while (cin >> luziHoge && luziHoge != 0)
    ;
}

int main() {
  int N, T, A, input;
  double hoge;
  cin >> N >> T >> A;
  double nearPointDiff = 100000;
  int nearPointNum = 10000;
  double idealHight = (T - A) / 0.006;
  for (int i = 0; i < N; i++) {
    cin >> input;
    hoge = fabs(input - idealHight);
    if (hoge < nearPointDiff) {
      nearPointNum = i;
      nearPointDiff = hoge;
    }
  }
  cout << nearPointNum + 1 << endl;

  // LoopUtZeroIn();
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   21 |     hoge = fabs(input - idealHight);
      |            ^~~~
      |            labs
Language: C++

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

#define FOR(i, n) for(int i = 0; i < (n); i++)
#define FORq(i, m, n) for(int i = (m); i < (n); i++)
#define FORr(i, n) for (int i = (n); i >= 0; i++)

int main() {
	int N, T, A, num;
	float ans;
	cin >> N;
	cin >> T >> A;
	vector<int> H(N);
	FOR(i, N) {
		cin >> H[i];
	}
	ans = T - (H[0] * 0.006);
	num = 1;

	FORq(i, 1, N) {
		if (fabs(T - (H[i] * 0.006) - A) < fabs(ans - A)) {
			ans = T - (H[i] * 0.006);
			num = i + 1;
		}
	}

	cout << num << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   24 |                 if (fabs(T - (H[i] * 0.006) - A) < fabs(ans - A)) {
      |                     ^~~~
      |                     labs
Language: C++

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

int main(){
  int N, T, A;
  cin >> N >> T >> A;
  double t = 1e9;
  int ans = -1;
  for(int i = 0; i < N; ++i){
    int h;
    cin >> h;
    if(abs(T-0.006*h-A) < t){
      ans = i+1;
      t = abs(T-0.006*h)-A);
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: expected ';' before ')' token
   17 |       t = abs(T-0.006*h)-A);
      |                           ^
      |                           ;
Language: C++

#include<vector>
#include<cmath>

int main(int argc, char **argv) {
    int n, t, a, ans, diff;
    std::vector<int> h;

    std::cin >> n >> t >> a;

    for (int i = 0; i < n;i++) {
        int input;
        std::cin >> input;
        h.push_back(input);
        h[i] = t - h[i] * 0.006;
    }

    diff = abs(a - h[0]);
    ans = 1;
    for (int j = 0; j < n; j++) {
        if (abs(a - h[j]) < diff) {
            diff = abs(a - h[j]);
            ans = j + 1;
        }
    }

    std::cout << ans << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:8:10: error: 'cin' is not a member of 'std'
    8 |     std::cin >> n >> t >> a;
      |          ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<cmath>
  +++ |+#include <iostream>
    3 | 
a.cc:12:14: error: 'cin' is not a member of 'std'
   12 |         std::cin >> input;
      |              ^~~
a.cc:12:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:10: error: 'cout' is not a member of 'std'
   26 |     std::cout << ans << std::endl;
      |          ^~~~
a.cc:26:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:30: error: 'endl' is not a member of 'std'
   26 |     std::cout << ans << std::endl;
      |                              ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<cmath>
  +++ |+#include <ostream>
    3 |
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#include<bits/stdc++.h>
#include <utility>

#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,a,b) for(int i = (a); (b) <= i; i--)
#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = n; n <= i; i--)
#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))
#define elif else if
#define MOD 1000000007
#define INF (1<<29)

using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

struct C{
  ll city_number;
  ll per_number;
  ll year;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  double N,T,A;
  cin >> N >> T >> A;
  double H[100010]={0};
  for(int i=1;i<=N;i++){
    cin >> H[i];
  }
  int ans=1;
  double tmp=0;
  for(int i=2;i<=N;i++){
    tmp=T-0.006*H[i];
    if(abs(A-tmp)<abs(A-H[ans])){
      ans=i;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:38:2: error: expected ';' after struct definition
   38 | }
      |  ^
      |  ;
Language: C++

#include <iostream>
#include <cstdlib>
#include <limits>
using namespace std;

int main(void) {
	int n, t, a;
	int h[1001], best;
	int ren;
	cin >> n >> t >> a;
	for (int i = 0; i < n; i++) {
		cin >> h[i];
	}
	best = INT_MAX;
	int tmp;
	for (int i = 0; i < n; i++) {
		h[i] = t - h[i] * 0.0006;
		tmp = h[i] - a;
		tmp = abs(tmp);
		if (tmp < best) {
			best = tmp;
			ren = i + 1;
		}
	}
	cout << ren << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'INT_MAX' was not declared in this scope
   14 |         best = INT_MAX;
      |                ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <limits>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <string>

using namespace std;

void LoopUtZeroIn() {
  int luziHoge = 10;
  while (cin >> luziHoge && luziHoge != 0)
    ;
}

int main() {
  int N, T, A, input;
  cin >> N >> T >> A;
  double nearPointDiff = 100000;
  int nearPointNum = 10000;
  double idealHight = (T - A) / 0.006;
  for (int i = 0; i < N; i++) {
    cin >> input;
    input = fabs(input - idealHight);
    if (input < nearPointDiff) {
      nearPointNum = i;
      nearPointDiff = input;
    }
  }
  cout << nearPointNum + 1 << endl;

  //LoopUtZeroIn();
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   20 |     input = fabs(input - idealHight);
      |             ^~~~
      |             labs
Language: C++

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <map>
using namespace std;

int main()
{
	int nN, nT, nA;
	cin >> nN >> nT >> nA;
	
	int nH;
	double dbMinAbs = DBL_MAX;
	int nMinIdx = -1;
	for (int i = 0; i < nN; i++)
	{
		cin >> nH;
		double dbTemp = nT - 0.006*nH;
		double dbAbs = abs(nA - dbTemp);
		if (dbMinAbs > dbAbs)
		{
			dbMinAbs = dbAbs;
			nMinIdx = i;
		}
	}

	cout << nMinIdx+1;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: 'DBL_MAX' was not declared in this scope
   14 |         double dbMinAbs = DBL_MAX;
      |                           ^~~~~~~
a.cc:6:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
    5 | #include <map>
  +++ |+#include <cfloat>
    6 | using namespace std;
Language: C++

#include<vector>
#include<cmath>

using namespace std;

int main(int argc, char **argv) {
    int n, t, a, ans, diff;
    vector<int> h;

    cin >> n >> t >> a;

    for (int i = 0; i < n;i++) {
        int input;
        cin >> input;
        h.push_back(input);
        h[i] = t - h[i] * 0.006;
    }

    diff = abs(a - h[0]);
    ans = 1;
    for (int j = 0; j < n; j++) {
        if (abs(a - h[j]) < diff) {
            diff = abs(a - h[j]);
            ans = j + 1;
        }
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> n >> t >> a;
      |     ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<cmath>
  +++ |+#include <iostream>
    3 | 
a.cc:28:5: error: 'cout' was not declared in this scope
   28 |     cout << ans << endl;
      |     ^~~~
a.cc:28:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:20: error: 'endl' was not declared in this scope
   28 |     cout << ans << endl;
      |                    ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<cmath>
  +++ |+#include <ostream>
    3 |
Language: C++

#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
	double n, t, a, min = -1;
	int ans = -1;
	cin >> n >> t >> a;
	t -= a;
	int *h = new int[n];
	for (int i = 0; i < n; i++) {
		cin >> h[i];
		if (abs(h[i] * 0.006 - t) < min || ans == -1) {
			min = abs(h[i] * 0.006 - t);
			ans = i;
		}
	}
	cout << ans + 1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expression in new-declarator must have integral or enumeration type
    9 |         int *h = new int[n];
      |                          ^
Language: C++

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

int main(void){
int n,t,a,i,j;
double k,b;
cin >>n;
cin>> t >>a;
int　h[n];
for(i=0;i<n;i++) cin>>h[i];
b=1141.0 ;
for(i=0;i<n;i++){
k=abs(a-t+h[i]*0.006);
if(k<b){
b=k;
j=i
}
}
cout <<j;
return 0;
}


Compiler output:
a.cc:10:1: error: extended character 　 is not valid in an identifier
   10 | int　h[n];
      | ^
a.cc: In function 'int main()':
a.cc:10:1: error: 'int\U00003000h' was not declared in this scope
   10 | int　h[n];
      | ^~~~~~
a.cc:11:23: error: 'h' was not declared in this scope
   11 | for(i=0;i<n;i++) cin>>h[i];
      |                       ^
a.cc:14:11: error: 'h' was not declared in this scope
   14 | k=abs(a-t+h[i]*0.006);
      |           ^
a.cc:17:4: error: expected ';' before '}' token
   17 | j=i
      |    ^
      |    ;
   18 | }
      | ~
Language: C++

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

int main(void){
int n,t,a,i,j;
double k,b;
cin >>n;
cin>> t >>a;
int　h[n];
for(i=0;i<n;i++) cin>>h[i];
b=1141.0 ;
for(i=0;i<n;i++){
k=abs(a-t+h[i]*0.006)
if(k<b){
b=k;
j=i
}
}
cout <<j;
return 0;
}


Compiler output:
a.cc:10:1: error: extended character 　 is not valid in an identifier
   10 | int　h[n];
      | ^
a.cc: In function 'int main()':
a.cc:10:1: error: 'int\U00003000h' was not declared in this scope
   10 | int　h[n];
      | ^~~~~~
a.cc:11:23: error: 'h' was not declared in this scope
   11 | for(i=0;i<n;i++) cin>>h[i];
      |                       ^
a.cc:14:11: error: 'h' was not declared in this scope
   14 | k=abs(a-t+h[i]*0.006)
      |           ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <cstdlib>
using namespace std;
using ll = long long int;

int main()
{
    double N;
    double T,A;
    cin >> N;
    cin >> T >> A;
    pair<double,double> H[N];

    for (int i = 0; i < N; i++) {
        cin >> H[i].first;
        H[i].second = i+1;
    }

    for (int i = 0; i < N; i++) {
        H[i].first = abs(T - H[i].first * 0.006 - A);
    }

    sort(H,H+N);
    cout << H[0].second << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:27: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   20 |     pair<double,double> H[N];
      |                           ^
a.cc:20:27: error: could not convert 'N' from 'double' to 'long unsigned int'
   20 |     pair<double,double> H[N];
      |                           ^
      |                           |
      |                           double
a.cc:20:27: error: size of array 'H' has non-integral type 'double'
a.cc:31:13: error: invalid operands of types 'std::pair<double, double> [1]' and 'double' to binary 'operator+'
   31 |     sort(H,H+N);
      |            ~^~
      |            | |
      |            | double
      |            std::pair<double, double> [1]
Language: C++

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

int main()
{
	int n, t, a, count = 1, b;
	cin >> n >> t >> a;
	float h[n], mini = 100000.0;
	for (int i = 0; i < n; i++) {

		cin >> b;
		h[i] = b * 0.006;
	}
	for (int i = 0; i < n; i++) {
		if (abs(a - h[i]) <= min) {
			min = (a - h[i]);
			count = (i + 1);
		}
	}
	cout << count;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:35: error: invalid operands of types 'float' and '<unresolved overloaded function type>' to binary 'operator<='
   16 |                 if (abs(a - h[i]) <= min) {
      |                     ~~~~~~~~~~~~~~^~~~~~
a.cc:17:40: error: overloaded function with no contextual type information
   17 |                         min = (a - h[i]);
      |                                        ^