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

#include <iostream>
using namespace std;

int main()
{
  int n
  double t,a;
  cin >> n >> t >> a;
  int h[n];
  int i;
  for(i = 0;i < n;i++){
    cin >> h[i]
  }
  double sa[n];
  int ans = 0;
  for(i = 0;i < n;i++){
    sa[i] = a -(t - 0.006*h[i]);
    if(sa[i] < 0){
    sa[i] = -sa[i];}
  }
  for(i = 0;i < n;i++){
    if(sa[ans] > sa[i]){
      ans = i;
    }
  }
  ans++;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'double'
    7 |   double t,a;
      |   ^~~~~~
a.cc:8:10: error: 'n' was not declared in this scope
    8 |   cin >> n >> t >> a;
      |          ^
a.cc:8:15: error: 't' was not declared in this scope; did you mean 'tm'?
    8 |   cin >> n >> t >> a;
      |               ^
      |               tm
a.cc:8:20: error: 'a' was not declared in this scope
    8 |   cin >> n >> t >> a;
      |                    ^
a.cc:12:12: error: 'h' was not declared in this scope
   12 |     cin >> h[i]
      |            ^
a.cc:17:5: error: 'sa' was not declared in this scope
   17 |     sa[i] = a -(t - 0.006*h[i]);
      |     ^~
a.cc:17:27: error: 'h' was not declared in this scope
   17 |     sa[i] = a -(t - 0.006*h[i]);
      |                           ^
a.cc:22:8: error: 'sa' was not declared in this scope
   22 |     if(sa[ans] > sa[i]){
      |        ^~
Language: C++

#include <stdio.h>
int main()
{
      int n, t, d, index;
      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:10:26: error: 'h' was not declared in this scope
   10 |             scanf("%d", &h);
      |                          ^
Language: C++

#include<bits/stdc++.h>
#include<string>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
  int n; cin >> n;

  int t, a; cin >> t >> a;
  int ans;
  int temperature = 20000;

  int h[n];
  for(int i = 1; i <= n; i++){
    cin >> h[i];
  }

  for(int i = 1; i <= n; i++){
    if(abs(t - a - h[i]*0.006) < temperature){
      temperature = abs(t - a - h[i]*0.006)
      ans = i;
    }
    
  }

  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:44: error: expected ';' before 'ans'
   22 |       temperature = abs(t - a - h[i]*0.006)
      |                                            ^
      |                                            ;
   23 |       ans = i;
      |       ~~~
Language: C

#include<stdio.h>
#include <stdlib.h>
int main(){
    int n,t,a;
    char h[100000];
    // 整数の入力
    scanf("%d", &n);
    // スペース区切りの整数の入力
    scanf("%d %d",&t,&a);
    // 文字列の入力
    scanf("%s",&h[n]);
    //温度差
    h[n]= abs(h[n]-a)
    int min;
    for(i=0;i<=n;i++){
        /* 最小値求める */
        if(h[n]<min)
        min=h[n];
    }


    // 出力
    printf("%d %s\n",a+b+c,s);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:22: error: expected ';' before 'int'
   13 |     h[n]= abs(h[n]-a)
      |                      ^
      |                      ;
   14 |     int min;
      |     ~~~               
main.c:15:9: error: 'i' undeclared (first use in this function)
   15 |     for(i=0;i<=n;i++){
      |         ^
main.c:15:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:17: error: 'min' undeclared (first use in this function); did you mean 'main'?
   17 |         if(h[n]<min)
      |                 ^~~
      |                 main
main.c:23:24: error: 'b' undeclared (first use in this function)
   23 |     printf("%d %s\n",a+b+c,s);
      |                        ^
main.c:23:26: error: 'c' undeclared (first use in this function)
   23 |     printf("%d %s\n",a+b+c,s);
      |                          ^
main.c:23:28: error: 's' undeclared (first use in this function)
   23 |     printf("%d %s\n",a+b+c,s);
      |                            ^
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()
{
    ll N;
    ll T,A;
    cin >> N;
    cin >> T >> A;
    static pair<ll,ll> 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:24: error: storage size of 'H' isn't constant
   20 |     static pair<ll,ll> H[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)
      |           ^
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 <<i;
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<bits/stdc++.h>
#define lp2(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
	int n,t,a,x,mn=INT_MAX,ans;
	cin>>n>>t>>a;
	lp2(i,n){
		cin>>x;
		if(fabs(t-x*0.006-a)=<mn){
			mn=fabs(t-x*0.006-a);
			ans=i+1;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:38: error: expected primary-expression before '<' token
   10 |                 if(fabs(t-x*0.006-a)=<mn){
      |                                      ^
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;
pair<ll,ll> H[N];

int main()
{
    ll N;
    ll T,A;
    cin >> N;
    cin >> T >> A;

    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:13:15: error: 'N' was not declared in this scope
   13 | pair<ll,ll> H[N];
      |               ^
a.cc: In function 'int main()':
a.cc:23:16: error: 'H' was not declared in this scope
   23 |         cin >> H[i].first;
      |                ^
a.cc:28:9: error: 'H' was not declared in this scope
   28 |         H[i].first = abs(T - H[i].first * 0.006 - A);
      |         ^
a.cc:31:10: error: 'H' was not declared in this scope
   31 |     sort(H,H+N);
      |          ^
Language: C

#include <stdio.h>

int main()
{
	int N,T,A;
	scanf("%d %d %d",&N,&T,&A);
	int H[N];
	for (int i = 0; i < N; ++i)
	{
		scanf("%d",&H[i]);
		H[i] -= A;
		if(H[i] < 0){
			H[i] *= -1:
		}
	}
	for (int i = N; i > 1; --i)
	{
		for (int j = 1; i < i; ++j)
		{
			int tmp = H[j];
			H[j] = H[j-1];
			H[j-1] = tmp;
		}
	}
	printf("%d",&H[N-1]);

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:35: error: expected ';' before ':' token
   13 |                         H[i] *= -1:
      |                                   ^
      |                                   ;
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int n;
	cin >> n;
	int t, a, xx=0;
	double b, maxv=0;
	cin >> t >> a;
	
	int x[n+1];
	
	for(int i=1; i<=n; i++)
	{
		cin >> x[i];
		b=t-x[i]*0.006;
		if(fabs(a-b)<fabs(a-maxv))
			{
				maxv=b;
				xx=i;
			}
	}
	cout << xx << endl;	
	
	return 0;
}

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

// abc113.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include "pch.h"
#include <climits>
#include <iostream>
#include <cstdio>
using namespace std;

double dabs(double a) { return a < 0 ? -a : a; }

int main()
{
	double n, t, a, h, anst = INT_MAX;
	int i,ansn;
	cin >> n >> t >> a;
	for (i = 0; i < n; i++)
	{
		cin >> h;
		//printf("%lf:%lf\n", t - h * 0.006 - a, anst);
		if (dabs(t - h * 0.006 - a) < anst)
		{
			anst = dabs(t - h * 0.006-a);
			ansn = i + 1;
		}
	}
	cout << ansn << endl;
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


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

#include <bits/stdc++.h>
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);
  }
  int num;
  vector<int> temp(n);
  for (int i = 0; i<n; i++){
    temp.at(i) = t - H.at(i) * 0.006;
  }
  vector<int> L(n);
  for (int i = 0; i<n; i++){
      L.at(i) = abs(a - temp.at(i));
  }
  int min_L = 100, num = 0;
  for (int i = 0; i<n; i++){
    min_L = min(min_L, L.at(i))
    if(min_L == L.at(i)){
       num = i + 1
    }
  }
  cout << num << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: redeclaration of 'int num'
   20 |   int min_L = 100, num = 0;
      |                    ^~~
a.cc:11:7: note: 'int num' previously declared here
   11 |   int num;
      |       ^~~
a.cc:22:32: error: expected ';' before 'if'
   22 |     min_L = min(min_L, L.at(i))
      |                                ^
      |                                ;
   23 |     if(min_L == L.at(i)){
      |     ~~
Language: C++

/*作者 Andy_He
  题目来源：*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,t,a,h,pos;
	cin>>n>>t>>a;
	float mind=10000;
	float ht[n+1];
	for(int i=1;i<=n;i++)
	{ 
		 cin>>h;
		 ht[i]=t-h*0.006;
		 if(abs(ht[i]-a)<mind)
		 	mind=abs(ht[i]-a;
			pos=i;
	} 
	cout<<pos<<endl;	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:41: error: expected ')' before ';' token
   16 |                         mind=abs(ht[i]-a;
      |                                 ~       ^
      |                                         )
Language: C++

    #include <iostream>
     
    using namespace std;
 int main() {
    int N, T, H;
    cin >> N;
    double mn = 10000000, mndx = -1;
    for (int i = 0; i < N; i++) {
      cin >> H;
      if (T - H * 0.006 < mn) {
        mn = T - H * 0.006;
        mndex = i + 1;
      }
    }
    cout << mndex;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'mndex' was not declared in this scope; did you mean 'mndx'?
   12 |         mndex = i + 1;
      |         ^~~~~
      |         mndx
a.cc:15:13: error: 'mndex' was not declared in this scope; did you mean 'mndx'?
   15 |     cout << mndex;
      |             ^~~~~
      |             mndx
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int n;
	cin >> n;
	int t, a, b, maxv=0, xx=0;
	cin >> t >> a;
	
	int x[n+1];
	
	for(int i=1; i<=n; i++)
	{
		cin >> x[i];
		b=t-x[i]*0.006;
		if(fabs(a-b)<fabs(a-maxv))
			{
				maxv=b;
				xx=i;
			}
	}
	cout << xx << endl;	
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   17 |                 if(fabs(a-b)<fabs(a-maxv))
      |                    ^~~~
      |                    labs
Language: C++

n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))


ans = 1
c = h[0]
d = abs(h[0]-a)
h = [t-0.006*i for i in h]

for i in range(n):
    if abs(h[i]-a)<d:
        d=abs(h[i]-a)
        ans = i+1

print(ans)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

// abc113.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include "pch.h"
#include <climits>
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
	double n, t, a, h, anst = INT_MAX;
	int i,ansn;
	cin >> n >> t >> a;
	for (i = 0; i < n; i++)
	{
		cin >> h;
		//printf("%lf:%lf\n", t - h * 0.006 - a, anst);
		if (max(t - h * 0.006 - a,-t + h * 0.006 + a) < anst)
		{
			anst = abs(t - h * 0.006-a);
			ansn = i + 1;
		}
	}
	cout << ansn << endl;
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


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

/*作者 Andy_He
  题目来源：*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,t,a,h,pos;
	cin>>n>>t>>a;
	float mind=10000;
	float ht[n+1];
	for(int i=1;i<=n;i++)
	{ 
		 cin>>h;
		 ht[i]=t-h*0.006;
		 if(abs(ht[i]-a)<mind)
		 mind=abs(ht[i]-a;
		 pos=i;
	} 
	cout<<pos<<endl;	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: expected ')' before ';' token
   16 |                  mind=abs(ht[i]-a;
      |                          ~       ^
      |                                  )
Language: C++

#include <iostream>

using namespace std;

int N, T, H;
cin >> N;
double mn = 10000000, mndx = -1;
for (int i = 0; i < N; i++) {
  cin >> H;
  if (T - H * 0.006 < mn) {
    mn = T - H * 0.006;
    mndex = i + 1;
  }
}
cout << mndex;

Compiler output:
a.cc:6:1: error: 'cin' does not name a type
    6 | cin >> N;
      | ^~~
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for (int i = 0; i < N; i++) {
      | ^~~
a.cc:8:17: error: 'i' does not name a type
    8 | for (int i = 0; i < N; i++) {
      |                 ^
a.cc:8:24: error: 'i' does not name a type
    8 | for (int i = 0; i < N; i++) {
      |                        ^
a.cc:15:1: error: 'cout' does not name a type
   15 | cout << mndex;
      | ^~~~
Language: C++

/*作者 Andy_He
  题目来源：*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,t,a,h,pos;
	cin>>n>>t>>a;
	float mind=10000;
	float ht[n+1];
	for(int i=1;i<=n;i++)
	{ 
		 cin>>h;
		 ht[i]=t-h*0.006;
		 if(abs(ht[i]-a)<mind)
		 mind=abs(ht[i]-a;
		 pos=i;
	} 
	cout<<i<<endl;	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: expected ')' before ';' token
   16 |                  mind=abs(ht[i]-a;
      |                          ~       ^
      |                                  )
a.cc:19:15: error: 'i' was not declared in this scope
   19 |         cout<<i<<endl;
      |               ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define LLINF 1e18//1234567890987654321
#define INF 1234567890
#define pb push_back
#define ins insert
#define f first
#define s second
#define db 0
#define EPS (1e-7)    //0.0000001 the value
#define PI (acos(-1))
#define MAXN 200006
#define MAXK 26
#define MAXX 15000006
#define ll long long int
#define ld long double
#define rep0(kk, l1, l2)for(ll kk = l1; kk < l2; kk++)
#define rep1(kk, l1, l2)for(ll kk = l1; kk <= l2; kk++)
#define forit(it, A) for(set<ll>::iterator it = A.begin(); it != A.end(); it++)
#define cr(x) cerr << #x << " = " << x << "\n";
#define crA(x, A) cerr << #x << " = " << A[x] << "\n";
#define spacing cout << " ";
#define mmst(x, v) memset((x), v, sizeof ((x)));
#define bg(ms) (*ms.begin())
#define ed(ms) (*prev(ms.end(), 1))
#define addedge(a, b, c, v) v[(a)].pb(pi((b), (c))); v[(b)].pb(pi((a), (c)))
#define ph push
#define btinpct(x) __builtin_popcountll(x)
#define p2(x) (1LL<<(x))
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
typedef pair <ll, ll> pi;
typedef pair <ll, pi> spi;
typedef pair <pi, pi> dpi;
ld n, t, a, ans=INF, pos;
ld abss(ld y)
{
return (y) > (-y) ? y : (-y) 
}
int main()
{
	cin >> n >> t >> a;
	for(ll i = 0; i < n; i++)
	{
		ld x;
		cin >> x;	
		// cout << abs(t - ((long double)x*0.006)) << "\n";
		if(abss(a - (t - ((long double)x*0.006))) < ans)pos = i, ans = abss(a - (t - ((long double)x*0.006)));
	}
	cout << pos+1 << "\n";
}


Compiler output:
a.cc: In function 'long double abss(long double)':
a.cc:40:29: error: expected ';' before '}' token
   40 | return (y) > (-y) ? y : (-y)
      |                             ^
      |                             ;
   41 | }
      | ~
Language: C

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

int main(void){
	int N,T,A,num;
	int H[1100] = {};
	int min = 1000000;
	scanf("%d",&N);
	scanf("%d",&T);
	scanf("%d",&A);
	A = abs(A);
	for (int i = 0; i < N; ++i){
		scanf("%d",&H[i]);
		int x = abs(T - (H[i] * 0.006))
		if (min > x - A){
			num = i+1;
		}
	}
	printf("%d\n",num );

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:13: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
   11 |         A = abs(A);
      |             ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    2 | #include <math.h>
  +++ |+#include <stdlib.h>
    3 | 
main.c:14:31: warning: 'abs' argument 1 type is 'double' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   14 |                 int x = abs(T - (H[i] * 0.006))
      |                             ~~^~~~~~~~~~~~~~~~
<built-in>: note: built-in 'abs' declared here
main.c:15:17: error: expected ',' or ';' before 'if'
   15 |                 if (min > x - A){
      |                 ^~
Language: C++

/*作者 Andy_He
  题目来源：*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,t,a,h,pos;
	cin>>n>>t>>a;
	float mind=10000;
	float ht[n+1];
	for(int i=1;i<=n;i++)
		 cin>>h;
		 ht[i]=t-h*0.006;
		 if(abs(ht[i]-a)<mind)
		 mind=abs(ht[i]-a;
		 pos=i;
		 
	cout<<i<<endl;	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: 'i' was not declared in this scope
   13 |                  ht[i]=t-h*0.006;
      |                     ^
Language: C++

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

using namespace std;

int main() {
	int N,T, A;
	int H[1010];
	cin >> N;
	cin >> T>>A;
	for (int i = 0; i < N;i++) {
		cin >> H[i];
	}
	double ter;
	ter = 1000.0 / 6.0 * double(T - A);
	int ans = 0;
	double temp = 10000000.0;
	for (int i = 0; i < N;i++) {
		if (fabs(double(H[i]) - ter) < temp) {
			ans = i+1;
			temp = fabs(double(H[i]) - ter);
		}
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   21 |                 if (fabs(double(H[i]) - ter) < temp) {
      |                     ^~~~
      |                     labs
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int t = sc.nextInt();
		int a = sc.nextInt();
		double[] h = new double[n];

		for(int i=0; i<n; i++){
			int b = sc.nextInt();
			h[i] = t - b*0.006;
		}

		double min = 110;
		int ans;
		for(int i=0; i<n; i++){
			double x;
			if(h[i] >= a){
				x = h[i]-a;
			}else{
				x = a - h[i];
			}
			if(x <= min){
				ans = i;
			}
		}
		System.out.println(ans+1);



	}
}

Compiler output:
Main.java:29: error: variable ans might not have been initialized
		System.out.println(ans+1);
		                   ^
1 error
Language: C++

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

main(){
  double n,t,a,i;
  cin >> n >> t >> a;
  double h,ans,d=;
  for (i=1;i<=n;i++) {
    cin >> h;
    if (d>fabs(a-t+h*0.006) {
      d=fabs(a-t+h*0.006);
      ans=i;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:18: error: expected primary-expression before ';' token
    9 |   double h,ans,d=;
      |                  ^
a.cc:12:28: error: expected ')' before '{' token
   12 |     if (d>fabs(a-t+h*0.006) {
      |        ~                   ^~
      |                            )
a.cc:16:3: error: expected primary-expression before '}' token
   16 |   }
      |   ^
Language: C++

// abc113.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//


#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
	double n, t, a, h, anst = INT_MAX;
	int i,ansn;
	cin >> n >> t >> a;
	for (i = 0; i < n; i++)
	{
		cin >> h;
		//printf("%lf:%lf\n", t - h * 0.006 - a, anst);
		if (abs(t - h * 0.006 - a) < anst)
		{
			anst = abs(t - h * 0.006-a);
			ansn = i + 1;
		}
	}
	cout << ansn << endl;
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


Compiler output:
a.cc: In function 'int main()':
a.cc:10:35: error: 'INT_MAX' was not declared in this scope
   10 |         double n, t, a, h, anst = INT_MAX;
      |                                   ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <cstdio>
  +++ |+#include <climits>
    7 | using namespace std;
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#define rep(it, ifrom, ito) for (auto it = ifrom; it != ito; ++it)

using namespace std;

int main(int argc, char* argv[]) {
    int N, T, A;
    scanf("%d %d %d", &N, &T, &A);
    vector<int> Hs;
    rep(i, 0, N) {
        int tmp;
        scanf("%d", &tmp);
        Hs.push_back(tmp);
    }

    int best_diff = INT_MAX;
    int best_i = 0;
    rep(i, 0, N) {
        int diff = std::abs((T * 1000 - Hs[i] * 6) - (A * 1000));
        if (diff < best_diff) {
            best_diff = diff;
            best_i = i;
        }
    }
    std::printf("%d\n", best_i + 1);

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:19:21: error: 'INT_MAX' was not declared in this scope
   19 |     int best_diff = INT_MAX;
      |                     ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <vector>
  +++ |+#include <climits>
    5 | #define rep(it, ifrom, ito) for (auto it = ifrom; it != ito; ++it)
Language: C++

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

int main(){
  long num=0;
  long M=0;
  long x=0;
  long a[2];
  long b[2];
  long c[10000];
  long n;
  int i,j;
    for(i=0;i<1;i++){
    scanf("%ld",a+i);
  }
  for(i=0;i<2;i++){
    scanf("%ld",b+i);
  }
  for(i=0;i<a[0];i++){
    scanf("%ld",c+i);
  }
  for(i=0;i<a[0];i++){
    if(abs(b[1]-(b[0]-c[x]*0.006))>abs((b[0]-c[i]*0.006)-b[1])){
      x=i;
    }
  }

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'flaot' was not declared in this scope; did you mean 'float'?
    6 |   flaot T,A;
      |   ^~~~~
      |   float
a.cc:7:8: error: 'T' was not declared in this scope
    7 |   cin>>T>>A>>endl;
      |        ^
a.cc:7:11: error: 'A' was not declared in this scope
    7 |   cin>>T>>A>>endl;
      |           ^
a.cc:11:13: error: no match for call to '(std::vector<int>) (int&)'
   11 |     cin>>vec(i);
      |          ~~~^~~
a.cc:12:10: error: expected ';' before 's'
   12 |     flaot s=min(A-( T-vec(i)*0.06),s);
      |          ^~
      |          ;
a.cc:14:9: error: 's' was not declared in this scope
   14 |   cout<<s;
      |         ^
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int t = sc.nextInt();
		int a = sc.nextInt();
		double[] h = new double[n];

		for(int i=0; i<n; i++){
			int b = sc.nextInt();
			h[i] = t - b*0.006;
		}

		int min = 110;
		int ans;
		for(int i=0; i<n; i++){
			int x;
			if(h[i] >= a){
				x = h[i]-a;
			}else{
				x = a - h[i];
			}
			if(x <= min){
				ans = i;
			}
		}
		System.out.println(ans+1);



	}
}

Compiler output:
Main.java:21: error: incompatible types: possible lossy conversion from double to int
				x = h[i]-a;
				        ^
Main.java:23: error: incompatible types: possible lossy conversion from double to int
				x = a - h[i];
				      ^
2 errors
Language: C

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,n,m) for(int i=(n);i<(m);i++)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) for(int i=(n);i>=0;i--)
#define all(vec) vec.begin(),vec.end()
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<int,int>;
using PP=pair<int,P>;
using Pl=pair<ll,ll>;
using PPl=pair<ll,Pl>;
using vs=vector<string>;
#define fi first
#define se second
#define pb push_back
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
const ll MOD=1000000007LL;
const int INF=1<<30;
const ll LINF=1LL<<60;
int main(){
	int n;
	cin>>n;
	double t,a;
	cin>>t>>a;
	vi vec(n);
	REP(i,n){
		cin>>vec[i];
	}
	vector<double> d(n);
	REP(i,n){
		d[i]=abs(t-0.006*vec[i]-a);
	}
	cout<<distance(d.begin(),min_element(all(d)))+1<<endl;
	return 0;
}

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

import java.util.*;

public class Main {
	public static void main(String[] args) {
		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 i=0; i<n; i++){
			int b = sc.nextInt();
			h[i] = t - b*0.006;
		}

		int min = 110;
		int ans;
		for(int i=0; i<n; i++){
			int x;
			if(h[i] >= a){
				x = h[i]-a;
			}else{
				x = a - h[i];
			}
			if(x <= min){
				ans = i;
			}
		}
		System.out.println(ans+1);



	}
}

Compiler output:
Main.java:13: error: incompatible types: possible lossy conversion from double to int
			h[i] = t - b*0.006;
			         ^
1 error
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<math.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int N,T,A,mini=100000000,minpos=0;

int main(){
    cin>>N>>T>>A;
    int H[1000];
    rep(i,N){
        cin>>H[i];
        H[i]*=1000;
        if(mini>abs(A*1000-(T*1000-H[i]*6)){
            mini=abs(A*1000-(T*1000-H[i]*6));
            minpos=i;
        }
    }
    out(minpos+1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:44: error: expected ')' before '{' token
   28 |         if(mini>abs(A*1000-(T*1000-H[i]*6)){
      |           ~                                ^
      |                                            )
a.cc:32:5: error: expected primary-expression before '}' token
   32 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
int N,T,A,ans=0;
double dif = 1e9,
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N >> T >> A;
	REP(i,N){
		int tmp;
		cin >> tmp;
		if(dif > fabs(A - (T - tmp * 0.006))){
          dif =  fabs(A - (T - tmp * 0.006));
          ans = i + 1;
        }
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:7:1: error: expected unqualified-id before 'int'
    7 | int main(){
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
int N,T,A,ans=0;
double dif = 1e9,
vector<int> H;
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N >> T >> A;
	REP(i,N){
		int tmp;
		cin >> tmp;
		if(dif > fabs(A - (T - tmp * 0.006))){
          dif =  fabs(A - (T - tmp * 0.006));
          ans = i + 1;
        }
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:7:13: error: invalid declarator before 'H'
    7 | vector<int> H;
      |             ^
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) {
		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 i=0; i<n; i++){
			h[i] = sc.nextInt();
			h[i] = t - h[i]*0.006;
		}

		int min = 110;
		int ans;
		for(int i=0; i<n; i++){
			int x;
			if(h[i] >= a){
				x = h[i]-a;
			}else{
				x = a - h[i];
			}
			if(x <= min){
				ans = i;
			}
		}
		System.out.println(ans+1);



	}
}

Compiler output:
Main.java:13: error: incompatible types: possible lossy conversion from double to int
			h[i] = t - h[i]*0.006;
			         ^
1 error
Language: C++

// Author: Jinhai Chen
#include <cstring>
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
const int INF = 0x3f3f3f3f;
typedef long long ll;
int n,A,t;
const int maxn = 1e5+10;
double h[maxn],a[maxn];


int main() {
#ifndef ONLINE_JUDGE
//	freopen("data.in","r",stdin);
#endif
	ios::sync_with_stdio(false);
	cin>>n>>t>>A;
	for(int i=1;i<=n;i++) cin>>h[i];
	for(int i=1;i<=n;i++) a[i]=t-0.6*h[i];
	double g=1e19;
	int ans=-1;
	for(int i=1;i<=n;i++) {
		if(fabs(a[i]-A)<g) {
			g=fabs(a[i]-A);
			ans=i;
		}
	}
	cout<<ans<<endl;
	return 0;
}














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

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#define rep(it, ifrom, ito) for (auto it = ifrom; it != ito; ++it)

using namespace std;

int main(int argc, char* argv[]) {
    bool debug = argc == 2 && (strcmp(argv[1], "debug") == 0);
    int N, T, A;
    scanf("%d %d %d", &N, &T, &A);
    vector<int> Hs;
    rep(i, 0, N) {
        int tmp;
        scanf("%d", &tmp);
        Hs.push_back(tmp);
    }

    if (debug) {
        printf("N=%d, T=%d, A=%d\n", N, T, A);
        rep(i, 0, N) {
            printf("H[%d]=%d ", i, Hs[i]);
        }
        printf("\n");
    }

    int best_diff = INT_MAX;
    int best_i = 0;
    rep(i, 0, N) {
        int diff = std::abs((T * 1000 - Hs[i] * 6) - (A * 1000)) / 1000;
        if (diff < best_diff) {
            best_diff = diff;
            best_i = i;
        }
    }
    std::printf("%d\n", best_i + 1);

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:10:32: error: 'strcmp' was not declared in this scope
   10 |     bool debug = argc == 2 && (strcmp(argv[1], "debug") == 0);
      |                                ^~~~~~
a.cc:5:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <vector>
  +++ |+#include <cstring>
    5 | #define rep(it, ifrom, ito) for (auto it = ifrom; it != ito; ++it)
a.cc:28:21: error: 'INT_MAX' was not declared in this scope
   28 |     int best_diff = INT_MAX;
      |                     ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <vector>
  +++ |+#include <climits>
    5 | #define rep(it, ifrom, ito) for (auto it = ifrom; it != ito; ++it)
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>

using namespace std;



int main() {

	int n;
	cin >> n;
	int t, a;
	cin >> t >> a;

	int min_num = 0;
	int min = INT_MAX;

	for (int i = 1; i <= n; i++) {
		int x;
		cin >> x;
		if (min > fabs(a - (t - 0.006*x))) {
			min = fabs(a - (t - 0.006*x));
			min_num = i;
		}
	}

	cout << min_num << endl;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: 'INT_MAX' was not declared in this scope
   21 |         int min = INT_MAX;
      |                   ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <map>
  +++ |+#include <climits>
    8 |
Language: C++

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

int main()
{
  int n,t,a;
  cin>>n>>t>>a;
  int h[n];
  for(int i=0; i<n; i++)
  {
    cin>>h[i];
  }
  double mini=0, minh= abs(t-h[0]*0.006 -a);
  for(int i=1; i<n; i++)
  {
    if(abs(t-h[i]*0.006 -a) < minh))
    {
      minh = abs(t-h[i]*0.006 -a);
      mini = i;
    }
  }
  cout<<mini<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:36: error: expected primary-expression before ')' token
   17 |     if(abs(t-h[i]*0.006 -a) < minh))
      |                                    ^
Language: C++

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

int main(){
	int n,t,a;
	cin>>n>>t>>a;
	int temp[n+1];
	for(int i=1;i<=n;i++){
		cin>>temp[i];
		temp[i]=t-temp[i]*0.006;
	}
	double minn=1000000,minv;
	for(int i=1;i<=n;i++){
		if(double(fabs(t-temp[i]))<minn){
			minn=double(fabs(t-temp[i]);)
			minv=i;
		} 
	} 
	cout<<minv;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: error: expected primary-expression before 'double'
   15 |                         minn=double(fabs(t-temp[i]);)
      |                              ^~~~~~
a.cc:15:53: error: expected primary-expression before ')' token
   15 |                         minn=double(fabs(t-temp[i]);)
      |                                                     ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<math.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int N,T,A,mini=100000,minpos=0;

int main(){
    cin>>N>>T>>A;
    int H[1000];
    rep(i,N){
        cin>>H[i];
        if(mini>abs((int)(A-(T-H[i]*0.006))){
            mini=abs(A-(T-H[i]*0.006));
            minpos=i;
        }
    }
    out(minpos+1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:45: error: expected ')' before '{' token
   27 |         if(mini>abs((int)(A-(T-H[i]*0.006))){
      |           ~                                 ^
      |                                             )
a.cc:31:5: error: expected primary-expression before '}' token
   31 |     }
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	double t,a;
	cin>>n>>t>>a;
	double h[n+1];
	double minn=10000;
	int ind;
	for(int i=1;i<=n;i++)
	{
		cin>>h[i];
		h[i]=t-h[i]*0.006;
		double cha=abs(h[i]-a);
		if(cha<minn)
		{
		   minn=cha;
		   ind=i;
		}   
	}
	cout<<ind<<endl;
	return 0;
}#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	double t,a;
	cin>>n>>t>>a;
	double h[n+1];
	double minn=10000;
	int ind;
	for(int i=1;i<=n;i++)
	{
		cin>>h[i];
		h[i]=t-h[i]*0.006;
		double cha=abs(h[i]-a);
		if(cha<minn)
		{
		   minn=cha;
		   ind=i;
		}   
	}
	cout<<ind<<endl;
	return 0;
}

Compiler output:
a.cc:24:2: error: stray '#' in program
   24 | }#include<bits/stdc++.h>
      |  ^
a.cc:24:3: error: 'include' does not name a type
   24 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:26:5: error: redefinition of 'int main()'
   26 | int main()
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main()
      |     ^~~~
Language: C++

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

int main () {
	int N;
	cin >> N;
	int T, A;
	cin >> T >> A;
	vector<int> H(N);
	double diff = 1e10;
	int idx = -1;
	for (int i=0; i<N; ++i) {
	 	cin >> H[i];
		double temp = fabs(A - (T - H[i]*0.006));
		if (diff > temp) {
			diff = temp;
			idx = i+1;
		}
	}
	
	cout << idx << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:31: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   17 |                 double temp = fabs(A - (T - H[i]*0.006));
      |                               ^~~~
      |                               labs
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>

using namespace std;



int main() {

	int n;
	cin >> n;
	int t, a;
	cin >> t >> a;

	int min_num = 0;
	int min = INT_MAX;

	for (int i = 1; i <= n; i++) {
		int x;
		cin >> x;
		if (min > fabs(a - (t - 0.006*x))) {
			min = fabs(a - (t - 0.006*x));
			min_num = i;
		}
	}

	cout << min_num << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: 'INT_MAX' was not declared in this scope
   21 |         int min = INT_MAX;
      |                   ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <map>
  +++ |+#include <climits>
    8 |
Language: C

#include <stdio.h>

int main(void)
{
    int n, t, a, i, min;
    
    scanf("%d",&n);
    min = 100000;
    int h[n];
    double ans[n];
    
    scanf("%d %d",&t,&a);
    for(i=0;i<n;i++){
        scanf("%d"&h[i]);
        ans[i] = t - (t - h[i] * 0.006);
        ans[i] > min ? : min = ans[i];
    }
    return 0;
    
    
    
}



Compiler output:
main.c: In function 'main':
main.c:14:19: error: invalid operands to binary & (have 'char *' and 'int')
   14 |         scanf("%d"&h[i]);
      |               ~~~~^~~~~
      |               |     |
      |               |     int
      |               char *
main.c:16:30: error: lvalue required as left operand of assignment
   16 |         ans[i] > min ? : min = ans[i];
      |                              ^
Language: C++

#include <iostream>
#include <cmatn>

using namespace std;

int main(void) {

	int N, T, A, H[1005];

	cin >> N >> T >> A;

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

	 double tmp;

	int ans = 0;
	double save;
	save = abs(1.0*T - 0.006*H[1]-1.0*A);

	for (int i = 1; i <= N; i++) {
		tmp = 1.0*T - 0.006*H[i];
		if (abs(tmp - 1.0*A) <= save) { ans = i; save = abs(tmp - 1.0*A); }
	}
	cout << ans << endl;

	//system("pause");
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: cmatn: No such file or directory
    2 | #include <cmatn>
      |          ^~~~~~~
compilation terminated.
Language: Java

import java.util.*;
import java.awt.*;

public class Main {
    public static void main(String args[]) {
        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 i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }

        double ans = Math.abs(a - t + h[0]*0.006);
        int an = 1;
        for (int i = 1; i < n; i++) {
            if (Math.abs(a - t + h[i]*0.006) < ans) {
                ans = Math.abs(a - t + h[i]*0.006)
                an = i+1;
            }
        }

        System.out.println(an);
    }
}


Compiler output:
Main.java:20: error: ';' expected
                ans = Math.abs(a - t + h[i]*0.006)
                                                  ^
1 error
Language: C++

#include<bits/stdc++.h>

using namespace std;

int zettai(int a){
  return a>=0?a:-1;
}

int main(){
  int n, t, a;
  int h[1000];
  int ans;
  int b=100000;
  cin >> n;
  cin >> t >> a;
  for(int i=0;i!=n;i++){
    cin >> h[i];
    h[i]=t-(h[i]*0.006);
    if(zettai(a-h[i])<b){
      b=zettai(a-h[i]);
      ans=i;
    }
  }
  cout << i << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:11: error: 'i' was not declared in this scope
   24 |   cout << i << endl;
      |           ^
Language: C++

#include <iosteram>
#include <cmath>
using namespace std;
int main(){
int n, t,a;
cin >> n >> t >> a;
int i = 0;
double ness = 1e9;
for(int k=1;k<=n;k++){
int h;cin >> h;
if(ness > abs((double)h*0.006+a-t)){
i = k;ness = abs((double)h*0.006+a-t);
}
}cout << i;
return 0;
}

Compiler output:
a.cc:1:10: fatal error: iosteram: No such file or directory
    1 | #include <iosteram>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

typedef long long ll;
typedef pair<ll,ll> P;

const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

int main()
{
  double N, T, A;
  cin >> N >> T >> A;
  ll H[N];
  rep(i,0,N)cin >> H[i];

  ll ans = 0;
  ll Min = INF;
  rep(i,0,N) {
    if (Min > abs(A - (T - H[i] * 0.006))) {
      Min = abs(A - (T - H[i] * 0.006));
      ans = i;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   18 |   ll H[N];
      |        ^
a.cc:18:8: error: could not convert 'N' from 'double' to 'long unsigned int'
   18 |   ll H[N];
      |        ^
      |        |
      |        double
a.cc:18:8: error: size of array 'H' has non-integral type 'double'
Language: C++

#include<cstdio>
#include<vector>

using namespace std;

int main()
{
	int n, t, a;
	vector<int> h;
	int input;
	double res;
	int i;
	int index = 0;
	double min;

	scanf("%d %d %d",&n,&t,&a);

	scanf("%d", &input);

	min = abs((double)t - (double)input*0.006 - (double)a);
	
	for (i = 1; i < n; i++)
	{
		scanf("%d", &input);

		if (abs((double)t - (double)input*0.006 - (double)a) < min)
		{
			min = abs((double)t - (double)input*0.006 - (double)a);

			index = i;
		}
	}

	printf("%d\n", index + 1);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: 'abs' was not declared in this scope
   20 |         min = abs((double)t - (double)input*0.006 - (double)a);
      |               ^~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,k,n) for(int i=k;i<=n;i++)
using namespace std;
const int maxn=1005;
int n,t,a,aa;
double b[maxn],ans=0x3f3f3f3f;
int main()
{
	cin>>n>>t>>a;
	rep(i,1,n)
	{
		cin>>b[i];
		b[i]=((double)t-0.006*b[i]);
		if(abs(b[i]-(double)a)<ans)
		{
			ans=abs(b[i]-a);
			aa=i;
		}
	}
	cout<<i;
	return 0;
}

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

#include <iostream>
#include <cmath>
using namespace std;
int main(){
int n, t,a;
cin >> n >> t >> a;
int i = 0;
double ness = 1e9;
for(int k=1;k<=n;k++){
int h;cin >> h;
if(ness > abs((double)h*0.006+a-t)){
i = k;ness = abs((double)h*0.006+a-t);
}
cout << i;
return 0;
}

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

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int t = sc.nextInt();
    int a = sc.nextInt();
    int ans = 0;
    int sa = 1000000;
    for(int i = 0; i < n; i++) {
      int h = sc.nextInt();
      int s = Math.abs(a - (t - h * 0.006));
      if(s < sa) {
        sa = s;
        ans = (i + 1);
      }
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:13: error: incompatible types: possible lossy conversion from double to int
      int s = Math.abs(a - (t - h * 0.006));
                      ^
1 error
Language: C++

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

typedef long long ll;
typedef pair<ll,ll> P;

const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

int main()
{
  double N, T, A;
  cin >> N >> T >> A;
  double H[N];
  rep(i,0,N)cin >> H[i];

  ll ans = 0;
  ll Min = INF;
  rep(i,0,N) {
    if (Min > abs(A - (T - H[i] * 0.006))) {
      Min = abs(A - (T - H[i] * 0.006));
      ans = i;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   18 |   double H[N];
      |            ^
a.cc:18:12: error: could not convert 'N' from 'double' to 'long unsigned int'
   18 |   double H[N];
      |            ^
      |            |
      |            double
a.cc:18:12: error: size of array 'H' has non-integral type 'double'
Language: C++

#include <iosteram>
#include <cmath>
using namespace std;
int main(){
int n, t,a;
cin >> n >> t >> a;
int i = 0;
double ness = 1e9;
for(int k=1;k<=n;k++){
int h;cin >> h;
if(ness > abs((double)h*0.006+a-t)){
i = k;ness = abs((double)h*0.006+a-t);
}
cout << i;
return 0;
}

Compiler output:
a.cc:1:10: fatal error: iosteram: No such file or directory
    1 | #include <iosteram>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <climits>

using namespace std;

int n, T, A, h;

int ans = 1;
double minDiff = 1e10;

int main() {

	cin >> n >> T >> A;

	for (int i = 1; i <= n; ++i)
	{
		cin >> h;

		double diff = fabs(T - A - 0.006 * h);
		if (diff < minDiff) {
			minDiff = diff;
			ans = i;
		}
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:31: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   26 |                 double diff = fabs(T - A - 0.006 * h);
      |                               ^~~~
      |                               labs