criyle/codenet-compile-errors huggingface dataset:
Language: Java

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 num=110;
    int count =0;

    for(int i=0;i<N;i++){
      int H = sc.nextInt();
      int a=abs(A-(T-H*0.006));

      if(a < num)
      {
        num = a;
        count = i;
      }
  }
  System.out.println(i);
}
}


Compiler output:
Main.java:4: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
                     ^
  symbol:   class Scanner
  location: class Main
Main.java:14: error: cannot find symbol
      int a=abs(A-(T-H*0.006));
            ^
  symbol:   method abs(double)
  location: class Main
Main.java:22: error: cannot find symbol
  System.out.println(i);
                     ^
  symbol:   variable i
  location: class Main
4 errors
Language: Java

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 num=110;
    int count =0;
 
    for(int i=0;i<N;i++){
      int H = sc.nextInt();
      if(abs(A-(T-H*0.006) < num)
      {
        num = abs(A-(T-H*0.006);
        count = i;
      }
  }
  System.out.println(i);
 
}
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 num=110;
    int count =0;

    for(int i=0;i<N;i++){
      int H = sc.nextInt();
      int a=abs(A-(T-H*0.006));

      if(a < num)
      {
        num = a;
        count = i;
      }
  }
  System.out.println(i);
}
}


Compiler output:
Main.java:14: error: ')' expected
      if(abs(A-(T-H*0.006) < num)
                                 ^
Main.java:16: error: ')' or ',' expected
        num = abs(A-(T-H*0.006);
                               ^
Main.java:46: error: reached end of file while parsing
}
 ^
3 errors
Language: Java

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 num=110;
    int count =0;
 
    for(int i=0;i<N;i++){
      int H = sc.nextInt();
      if(abs(A-(T-H*0.006) < num)
      {
        num = abs(A-(T-H*0.006);
        count = i;
      }
  }
  System.out.println(i);
 
}
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 num=110;
    int count =0;

    for(int i=0;i<N;i++){
      int H = sc.nextInt();
      if(abs(A-(T-H*0.006)) < num)
      {
        num = abs(A-(T-H*0.006));
        count = i;
      }
  }
  System.out.println(i);
}
}


Compiler output:
Main.java:14: error: ')' expected
      if(abs(A-(T-H*0.006) < num)
                                 ^
Main.java:16: error: ')' or ',' expected
        num = abs(A-(T-H*0.006);
                               ^
Main.java:44: error: reached end of file while parsing
}
 ^
3 errors
Language: Java

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 num=110;
    int count =0;

    for(int i=0;i<N;i++){
      int H = sc.nextInt();
      if(abs(A-(T-H*0.006) < num)
      {
        num = abs(A-(T-H*0.006);
        count = i;
      }
  }
  System.out.println(i);

}


Compiler output:
Main.java:14: error: ')' expected
      if(abs(A-(T-H*0.006) < num)
                                 ^
Main.java:16: error: ')' or ',' expected
        num = abs(A-(T-H*0.006);
                               ^
Main.java:22: error: reached end of file while parsing
}
 ^
3 errors
Language: Java

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 num=110;
    int count =0;

    for(int =0;i<N;i++){
      int H = sc.nextInt();
      if(abs(A-(T-H*0.006) < num)
      {
        num = abs(A-(T-H*0.006);
        count = i;
      }
  }
  System.out.println(i);

}
    
      
 
      

Compiler output:
Main.java:12: error: not a statement
    for(int =0;i<N;i++){
        ^
Main.java:12: error: ';' expected
    for(int =0;i<N;i++){
           ^
Main.java:12: error: illegal start of expression
    for(int =0;i<N;i++){
            ^
Main.java:12: error: not a statement
    for(int =0;i<N;i++){
                ^
Main.java:12: error: ')' expected
    for(int =0;i<N;i++){
                  ^
Main.java:12: error: ';' expected
    for(int =0;i<N;i++){
                      ^
Main.java:14: error: ')' expected
      if(abs(A-(T-H*0.006) < num)
                                 ^
Main.java:16: error: ')' or ',' expected
        num = abs(A-(T-H*0.006);
                               ^
Main.java:22: error: reached end of file while parsing
}
 ^
9 errors
Language: C

# include <stdio.h>
2.int main ()
3.{
4.  int N,T,A,X;
5.scanf ("%d%d%d",&N ,&T ,&A);
6.int res =0;
7.int cc = 0;
8.for(int i =1;i <=N;i ++)
9.{
10.scanf ("%d",&X);
11.int d=(T *1000 -X*6) -A *1000;
12.if(d <0)d=-d;
13.if(cc < d)
14.  cc=d,res=i;
15.}
16.printf ("%d\n",res );
17.}

# include <stdio.h>
int main ()
{
  int N,T,A,X;
scanf ("%d%d%d",&N ,&T ,&A);
int res =0;
int cc = 1<<30;
for(int i =1;i <=N;i ++)
{
scanf ("%d",&X);
int d=(T *1000 -X*6) -A *1000;
if(d <0)d=-d;
if(cc > d)
  cc=d,res=i;
}
printf ("%d\n",res );
}


Compiler output:
main.c:2:1: error: invalid suffix "int" on floating constant
    2 | 2.int main ()
      | ^~~~~
main.c:2:1: error: expected identifier or '(' before numeric constant
main.c:5:1: error: invalid suffix "scanf" on floating constant
    5 | 5.scanf ("%d%d%d",&N ,&T ,&A);
      | ^~~~~~~
main.c:6:1: error: invalid suffix "int" on floating constant
    6 | 6.int res =0;
      | ^~~~~
main.c:7:1: error: invalid suffix "int" on floating constant
    7 | 7.int cc = 0;
      | ^~~~~
main.c:8:1: error: invalid suffix "for" on floating constant
    8 | 8.for(int i =1;i <=N;i ++)
      | ^~~~~
main.c:10:1: error: invalid suffix "scanf" on floating constant
   10 | 10.scanf ("%d",&X);
      | ^~~~~~~~
main.c:11:1: error: invalid suffix "int" on floating constant
   11 | 11.int d=(T *1000 -X*6) -A *1000;
      | ^~~~~~
main.c:16:1: error: invalid suffix "printf" on floating constant
   16 | 16.printf ("%d\n",res );
      | ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>   
#define ll long long
#define sz size
#define fr first
#define sc second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define int long long
using namespace std;

double n,t,a,h[1005];

signed main(){
    ios_base::sync_with_stdio(0);  cin.tie(); cout.tie();
    cin >> n >> t >> a;
    for(int i=1;i<=n;i++) cin >> h[i];
    double ans=1e19;
    double ans1=1e19;
    for(int i=1;i<=n;i++){
        double x;
        x=(t-0.006*h[i]);
        if(abs(x-t)<ans1){
        ans=i;
        ans1=abs(x-t);}
    }
    cout<<ans;
}#include<bits/stdc++.h>   
#define ll long long
#define sz size
#define fr first
#define sc second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define int long long
using namespace std;

double n,t,a,h[1005];

signed main(){
    ios_base::sync_with_stdio(0);  cin.tie(); cout.tie();
    cin >> n >> t >> a;
    for(int i=1;i<=n;i++) cin >> h[i];
    double ans=1e19;
    double ans1=1e19;
    for(int i=1;i<=n;i++){
        double x;
        x=(t-0.006*h[i]);
        if(abs(x-t)<ans1){
        ans=i;
        ans1=abs(x-t);}
    }
    cout<<ans;
}

Compiler output:
a.cc:31:2: error: stray '#' in program
   31 | }#include<bits/stdc++.h>
      |  ^
a.cc:31:3: error: 'include' does not name a type
   31 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:45:8: error: redefinition of 'double n'
   45 | double n,t,a,h[1005];
      |        ^
a.cc:15:8: note: 'double n' previously declared here
   15 | double n,t,a,h[1005];
      |        ^
a.cc:45:10: error: redefinition of 'double t'
   45 | double n,t,a,h[1005];
      |          ^
a.cc:15:10: note: 'double t' previously declared here
   15 | double n,t,a,h[1005];
      |          ^
a.cc:45:12: error: redefinition of 'double a'
   45 | double n,t,a,h[1005];
      |            ^
a.cc:15:12: note: 'double a' previously declared here
   15 | double n,t,a,h[1005];
      |            ^
a.cc:45:14: error: redefinition of 'double h [1005]'
   45 | double n,t,a,h[1005];
      |              ^
a.cc:15:14: note: 'double h [1005]' previously declared here
   15 | double n,t,a,h[1005];
      |              ^
a.cc:47:8: error: redefinition of 'int main()'
   47 | signed main(){
      |        ^~~~
a.cc:17:8: note: 'int main()' previously defined here
   17 | signed main(){
      |        ^~~~
Language: C++

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

using namespace std;


int main()
{
	int n, t, a;
	scanf_s("%d%d%d", &n, &t, &a);
	double sa = 1000000000;
	int ans = 0;
	for (int i = 0; i < n; i++) {
		int x;
		scanf_s("%d", &x);
		double k = t - a - x * 0.006;
		if (k < 0)k = -k;
		if (sa > k) {
			sa = k;
			ans = i + 1;
		}
	}
	printf("%d", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   14 |         scanf_s("%d%d%d", &n, &t, &a);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
 int abs2(int A){
     int a;
     if(A>=0){a=A;}else{a=-A;}
     return a;
}
int min(int n,int x[]){
    int y,i=0,j=0;
    y=x[0];
    while(i<n){
        if(x[i]<y){
            y=x[i];
            j=i;
        }
        i++;
    }
    return j+1;
}

int main(void){
    int N,T,A,h;
    float d;
    scanf("%d%d%d",&N,&T,&A);
    int H[N];
    for(int i=0;i<N;i++){
        scanf("%d",&H[i]);
    }
    for(int i=0;i<N;i++){
        d=H[i]*6;
        H[i]=abs2(1000A-1000T+d);
    }
    printf("%d\n",min(N,H));
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:30:19: error: invalid suffix "A" on integer constant
   30 |         H[i]=abs2(1000A-1000T+d);
      |                   ^~~~~
main.c:30:25: error: invalid suffix "T" on integer constant
   30 |         H[i]=abs2(1000A-1000T+d);
      |                         ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdlib>
#include <thread>
#include <chrono>

using namespace std;

int n, t, a;
vector<int> h;

double average_temp(int i){
	return t - (0.006 * i);
}

int main(void){
	cin >> n >> t >> a;
	for(int i=0;i<n;i++){
		cin >> h[i];
	}
	//Finish input

	vector<double> diff(n);
	for(int i=0;i<n;i++){
		diff.push_back(abs(a-average_temp(i)));
	}

	cout << *distance(diff.begin(), *min_element(diff.begin(), diff.end())) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:26: error: no matching function for call to 'distance(std::vector<double>::iterator, double&)'
   31 |         cout << *distance(diff.begin(), *min_element(diff.begin(), diff.end())) << endl;
      |                  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:47,
                 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_iterator_base_funcs.h:148:5: note: candidate: 'template<class _InputIterator> constexpr typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::distance(_InputIterator, _InputIterator)'
  148 |     distance(_InputIterator __first, _InputIterator __last)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:148:5: note:   template argument deduction/substitution failed:
a.cc:31:26: note:   deduced conflicting types for parameter '_InputIterator' ('__gnu_cxx::__normal_iterator<double*, std::vector<double> >' and 'double')
   31 |         cout << *distance(diff.begin(), *min_element(diff.begin(), diff.end())) << endl;
      |                  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include<stdio.h>
 int abs2(int A){
     int a;
     if(A>=0){a=A;}else{a=-A;}
     return a;
}
int min(int n,int x[]){
    int y,i=0,j=0;
    y=x[0];
    while(i<n){
        if(x[i]<y){
            y=x[i];
            j=i;
        }
        i++;
    }
    return j+1;
}
 
int main(void){
    int N,T,A,h;
    float d;
    scanf("%d%d%d",&N,&T,&A);
    int H[N],a[N];
    for(int i=0;i<N;i++){
        scanf("%d",&H[i]);
    }
    for(int i=0;i<N;i++){
        d=H[i]*0.006;
        a[i]=abs2(A-T+(int)d);
    }
int Answer=min(N,a)
    printf("%d\n",Answer);
        return 0;
}

Compiler output:
main.c: In function 'main':
main.c:33:5: error: expected ',' or ';' before 'printf'
   33 |     printf("%d\n",Answer);
      |     ^~~~~~
Language: C

#include<stdio.h>
 int abs2(int A){
     int a;
     if(A>=0){a=A;}else{a=-A;}
     return a;
}
int min(int n,int x[]){
    int y,i=0,j=0;
    y=x[0];
    while(i<n){
        if(x[i]<y){
            y=x[i];
            j=i;
        }
        i++;
    }
    return j+1;
}

int main(void){
    int N,T,A,h;
    float d;
    scanf("%d%d%d",&N,&T,&A);
"file.c" 34L, 553C


Compiler output:
main.c: In function 'main':
main.c:24:9: error: expected ';' before numeric constant
   24 | "file.c" 34L, 553C
      |         ^~~~
      |         ;
main.c:24:15: error: invalid suffix "C" on integer constant
   24 | "file.c" 34L, 553C
      |               ^~~~
main.c:24:1: error: expected declaration or statement at end of input
   24 | "file.c" 34L, 553C
      | ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    cout<<"hello"<<endl;
    return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: expected ';' before '}' token
    6 |     return 0
      |             ^
      |             ;
    7 | }
      | ~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdint>





using namespace std;



int main(){

    int n,t,a;
    cin >> n>>t>>a;
    int res = INT_MAX;
    int res_idx = 0;
    vector<int> v;
    for(int i=0;i<n;i++){
        int c;
        cin>>c;
        int curc = 12-1000*c;
        v.push_back(abs(curc - a));
    }

    cout << min_element(v.begin(), v.end()) - v.begin() + 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: 'INT_MAX' was not declared in this scope
   18 |     int res = INT_MAX;
      |               ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <cstdint>
  +++ |+#include <climits>
    5 |
Language: C++

#include <iostream>
#include <vector>



using namespace std;



int main(){

    int n,t,a;
    cin >> n>>t>>a;
    int res = INT_MAX;
    int res_idx = 0;
    vector<int> v;
    for(int i=0;i<n;i++){
        int c;
        cin>>c;
        int curc = 12-1000*c;
        v.push_back(abs(curc - a));
    }

    cout << min_element(v.begin(), v.end()) - v.begin() + 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: 'INT_MAX' was not declared in this scope
   14 |     int res = INT_MAX;
      |               ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <vector>
  +++ |+#include <climits>
    3 | 
a.cc:24:13: error: 'min_element' was not declared in this scope
   24 |     cout << min_element(v.begin(), v.end()) - v.begin() + 1;
      |             ^~~~~~~~~~~
Language: Java

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int t = Integer.parseInt(sc.next());
        double a = Double.parseDouble(sc.next());
        double minDiff = Integer.MAX_VALUE;
        Map<Integer, Integer> heightMap = new HashMap<>();

        for (int i = 1; i <= n; i++) {
        	int x = Integer.parseInt(sc.next());
        	heightMap.put(i,  x);
        }
        int ans = heightMap.entrySet().stream().map(h -> {
        	double ti = t - h.getValue() * 0.006;
        	int ansCandidate = 0;
        	if (Math.abs(a - ti) < minDiff) {
        		ansCandidate = h.getKey();
        		minDiff = Math.abs(a - ti);
        	}
        	return h.getKey();
        }).hashCode();

        System.out.println(ans);
    }
}

Compiler output:
Main.java:21: error: local variables referenced from a lambda expression must be final or effectively final
        	if (Math.abs(a - ti) < minDiff) {
        	                       ^
Main.java:23: error: local variables referenced from a lambda expression must be final or effectively final
        		minDiff = Math.abs(a - ti);
        		^
2 errors
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int N,T,A,H[1000];

	cin >> N >> T >> A;
	
	double ans = 1e18;
	
	for(int i=0; i<N; i++){
		cin >> H[i];
		ans = min(ans, abs(A - (T - H[i] * 0.006)));
	}

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

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: 'i' was not declared in this scope
   18 |         for(i=0; i<N; i++){
      |             ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int N,T,A,H[1000];

	cin >> N >> T >> A;
	
	double ans = 1e18;
	
	for(int i=0; i<N; i++){
		cin >> H[i];
		ans = min(abs(A - (T - H[i] * 0.006)));
	}

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

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: no matching function for call to 'min(double)'
   15 |                 ans = min(abs(A - (T - H[i] * 0.006)));
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
a.cc:15:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   15 |                 ans = min(abs(A - (T - H[i] * 0.006)));
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided
a.cc:18:13: error: 'i' was not declared in this scope
   18 |         for(i=0; i<N; i++){
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,n,t;
  cin>>a>>n>>t;
  int tem,pos=0,d=0;
  for(int i=0;i<n;i++)
  {
    cin>>h;
    tem=abs(a-(t-h*0.006))*1000;
    if(d<tem)
    {
      d=tem;
      pos=i+1;
    }
  }
  cout<<pos<<endl;
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,n,t;
  cin>> a >> n >> t;
  int tem,pos=0,d=0;
  for(int i=0;i<n;i++)
  {
    cin>>h;
    tem=abs(a-(t-h*0.006))*1000;
    if(d<tem)
    {
      d=tem;
      pos=i+1;
    }
  }
}

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

#include <stdio.h>

int avdif(int,int,int);

int main(void){
    int n,t,a;
    scanf("%d %d %d",&n,&t,&a);
    
    int h[n];
    int i,num,p=114514;
    for(i=0;i<n;i++){
        scanf("%d",&h[i]);
        h[i]=avdif(a,t,h[i]);
    }
    for(i=0;i<n;i++){
        if(h[i]<p){
            p=h[i];
            num=i+1;
        }
    }
    printf("%d\n",num);
    
    return 0;
}


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

#include<stdio.h>
#include<math.h>
int h[100001];
int main()
{
	int n,m,t,a,b,i;
	scanf("%d",&n);
	scanf("%d%d",&t,&a);
	b=1;
	for(i=0;i<n;i++)
	{
			scanf("%d",&h[i]);
		    m=t-h[i]*0.006;
	}
	double m,min=10000000000.0;
	for(i=0;i<n;i++)
	{
		if(fabs(m-a)<=min)
		{
			min=fabs(m-a);
			b=i;	
		}
	}
	printf("%d\n",b);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:16: error: conflicting types for 'm'; have 'double'
   15 |         double m,min=10000000000.0;
      |                ^
main.c:6:15: note: previous declaration of 'm' with type 'int'
    6 |         int n,m,t,a,b,i;
      |               ^
Language: C

a,t,h,s=1e9,id;
main()
{
	scanf("%*d%d%d",&t,&a);
	t=(t-a)*1000;
	for(;i++,~scanf("%d",&h);)
	{
		h*=6;
		if(abs(t-h)<s)
		{
			s=abs(t-h);
			id=i;
		}
	}
	printf("%d",id);
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | a,t,h,s=1e9,id;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    1 | a,t,h,s=1e9,id;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'h' [-Wimplicit-int]
    1 | a,t,h,s=1e9,id;
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
    1 | a,t,h,s=1e9,id;
      |       ^
main.c:1:13: error: type defaults to 'int' in declaration of 'id' [-Wimplicit-int]
    1 | a,t,h,s=1e9,id;
      |             ^~
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         scanf("%*d%d%d",&t,&a);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | a,t,h,s=1e9,id;
main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         scanf("%*d%d%d",&t,&a);
      |         ^~~~~
main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:14: error: 'i' undeclared (first use in this function); did you mean 'id'?
    6 |         for(;i++,~scanf("%d",&h);)
      |              ^
      |              id
main.c:6:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:20: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    9 |                 if(abs(t-h)<s)
      |                    ^~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
  +++ |+#include <stdlib.h>
    1 | a,t,h,s=1e9,id;
main.c:15:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   15 |         printf("%d",id);
      |         ^~~~~~
main.c:15:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

a,t,h,s=1e9,id;
main()
{
	scanf("%*d%d%d",&t,&a);
	t=(t-a)*1000;
	for(;i++,~scanf("%d",&h);)
	{
		h*=6;
		if(fabs(t-h)<s)
		{
			s=fabs(t-h);
			id=i;
		}
	}
	printf("%d",id);
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | a,t,h,s=1e9,id;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    1 | a,t,h,s=1e9,id;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'h' [-Wimplicit-int]
    1 | a,t,h,s=1e9,id;
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
    1 | a,t,h,s=1e9,id;
      |       ^
main.c:1:13: error: type defaults to 'int' in declaration of 'id' [-Wimplicit-int]
    1 | a,t,h,s=1e9,id;
      |             ^~
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         scanf("%*d%d%d",&t,&a);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | a,t,h,s=1e9,id;
main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         scanf("%*d%d%d",&t,&a);
      |         ^~~~~
main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:14: error: 'i' undeclared (first use in this function); did you mean 'id'?
    6 |         for(;i++,~scanf("%d",&h);)
      |              ^
      |              id
main.c:6:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:20: error: implicit declaration of function 'fabs' [-Wimplicit-function-declaration]
    9 |                 if(fabs(t-h)<s)
      |                    ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'fabs'
  +++ |+#include <math.h>
    1 | a,t,h,s=1e9,id;
main.c:9:20: warning: incompatible implicit declaration of built-in function 'fabs' [-Wbuiltin-declaration-mismatch]
    9 |                 if(fabs(t-h)<s)
      |                    ^~~~
main.c:9:20: note: include '<math.h>' or provide a declaration of 'fabs'
main.c:15:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   15 |         printf("%d",id);
      |         ^~~~~~
main.c:15:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#define pb push_back
using namespace std;
typedef pair<int,int> pii;

int main(){
  int n;
  double t,a;
  
  cin>>n;
  cin>>t>>a;
  
  double tmp,tmp2;
  int res=0;

  cin>>tmp;
  tmp=t-0.006*tmp;
  tmp2=tmp;
  
  for(int i=1;i<n;i++){
    cin>>tmp;
    tmp=t-0.006*tmp;
    if(fabs(tmp2-a)>fabs(tmp-a)){
      res=i;
      tmp2=tmp;
    }
  }
  cout<<res+1<<endl;
  
  return 0;
}


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

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

float cal_h(int x){}


int main(){
  int n,t,a,h,index;
  float result_old,result_new;


  cin >> n >> t >> a;
  result_old = 100000.000;
  for(int i=0;i<n;i++){
    cin >> h;
    result_new = abs(t - (h * 0.006) - a)
    if(result_new < result_old){
      index = i;
      result_old = result_new;
    }
  }
  cout << index << endl;
}


Compiler output:
a.cc: In function 'float cal_h(int)':
a.cc:7:20: warning: no return statement in function returning non-void [-Wreturn-type]
    7 | float cal_h(int x){}
      |                    ^
a.cc: In function 'int main()':
a.cc:19:42: error: expected ';' before 'if'
   19 |     result_new = abs(t - (h * 0.006) - a)
      |                                          ^
      |                                          ;
   20 |     if(result_new < result_old){
      |     ~~
Language: C++

/* Author rumoisen */
/* created 2018/11/07 */

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <cmath>
 
using namespace std;
 
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

void no(){cout<<"No"<<endl;exit(0);}
void yes(){cout<<"Yes"<<endl;exit(0);}
void No(){cout<<"NO"<<endl;exit(0);}
void Yes(){cout<<"YES"<<endl;exit(0);}

typedef long long ll;
typedef long long int llt;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

using namespace std;

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

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

#include<stdio.h>
#define abs(zz) ((zz>=0) ? (zz) : (-(zz)))

int main()
{
    int i,n,t,a,temp,ans=1000000000,d=0;
	int h[1010]={0},l[1010]={0};
	scanf("%d",&n);
	scanf("%d %d",&t,&a);
	for(i=0;i<n;i++)
	{
		scanf("%d",&(h[i]));
		temp=t-(h[i]*0.006);
		l[i]=abs(((temp)-(a)));
	}
	for(j=0;j<n;j++)
	{
		if(ans>l[j])
		{
			ans=l[j];
			d=(j+1);
		}
	}
	printf("%d",d);
}


Compiler output:
main.c: In function 'main':
main.c:16:13: error: 'j' undeclared (first use in this function)
   16 |         for(j=0;j<n;j++)
      |             ^
main.c:16:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

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

  
  return 0;
}

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

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

using namespace std;
void mondai1();
void mondai2();

int main()
{
	mondai2();
	return 0;
}

void mondai1() {
	int aTob, bToc,fare;
	cin >> aTob >> bToc;
	
	fare = aTob + bToc/2;

	cout << fare;
	
}

void mondai2() {
	vector<int> h;
	int n, t, a,htmp,average,diff,point;
	int minDiff = 1000000000;
	int x;
	
	cin >> n; //建設予定地の候補数
	cin >> t >> a;
	for (int i = 0; i < n; i++) {
		cin >> htmp;
		h.push_back(htmp);
	}


	point = 100;
	for (int i = 0; i < h.size(); i++) {
		average = 1000 *t - h[i] *6;//平均温度
		diff = average - 1000 * a; //平均温度と理想の温度の差

		if (minDiff > abs(diff)) {
			minDiff = abs(diff);
			point = i;
		}

		
	}
	cout << point + 1;


Compiler output:
a.cc: In function 'void mondai2()':
a.cc:51:27: error: expected '}' at end of input
   51 |         cout << point + 1;
      |                           ^
a.cc:25:16: note: to match this '{'
   25 | void mondai2() {
      |                ^
Language: C++

#include "stdafx.h"
#include "iostream"
#include <vector>
#include <cstdlib>

using namespace std;
void mondai1();
void mondai2();

int main()
{
	mondai2();
	return 0;
}

void mondai1() {
	int aTob, bToc,fare;
	cin >> aTob >> bToc;
	
	fare = aTob + bToc/2;

	cout << fare;
	
}

void mondai2() {
	vector<int> h;
	int n, t, a,htmp,average,diff,point;
	int minDiff = 1000000000;
	int x;
	
	cin >> n; //建設予定地の候補数
	cin >> t >> a;
	for (int i = 0; i < n; i++) {
		cin >> htmp;
		h.push_back(htmp);
	}


	point = 100;
	for (int i = 0; i < h.size(); i++) {
		average = 1000 *t - h[i] *6;//平均温度
		diff = average - 1000 * a; //平均温度と理想の温度の差

		if (minDiff > abs(diff)) {
			minDiff = abs(diff);
			point = i;
		}

		
	}
	cout << point + 1;
}

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

#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>

int a[10005];
int at[10005];
int H[10005];
int main(){
	int N;
	int T, A;
	int H;
	scanf("%d\n%d %d", &N, &T, &A);
	for(int i = 0; i < N; i++){
		scanf("%d ", &H[i]);		
	}
	for(int j = 0; i < N; j++){
		at[j] = abs(T - H[j] * 0.006 - A);
		a[j] = at[j];
	}
	sort(a, a+N);
	for(int i = 0; i < N; i++){
		if(at[i] == a[0])
		{
			printf("%d\n", i + 1);
		}
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:32: error: invalid types 'int[int]' for array subscript
   16 |                 scanf("%d ", &H[i]);
      |                                ^
a.cc:18:24: error: 'i' was not declared in this scope
   18 |         for(int j = 0; i < N; j++){
      |                        ^
a.cc:19:34: error: invalid types 'int[int]' for array subscript
   19 |                 at[j] = abs(T - H[j] * 0.006 - A);
      |                                  ^
a.cc:22:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   22 |         sort(a, a+N);
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C

#include <stdio.h>
int main(){
  
    int N,i;
    double H[1000],Ta[1000],Tb[1000];
    double T,A,max=1000;
  
    scanf("%d", N);
    scanf("%lf", T);
    scanf("%lf", A);
  
    for(i = 0; i < N, ++i){
      scanf("%lf", H[i]);
    }
  
    for(i = 0; i < N; ++i){
      Ta[i] = T - H[i] * 0.006;
    }
  
    for(i = 0; i < N; ++i){
      if(A - Ta[i] < 0){
        Tb[i] = Ta[i] - A;
      }
      else {
        Tb[i] = A - Ta[i];
      }
    }
  
    for(i = 0; i < N; ++i){
      if(Tb[i] < max){
        max = Tb[i];
      }
    }
  
    printf("%lf\n", max);
  
    return 0;
}
  
  
        

Compiler output:
main.c: In function 'main':
main.c:12:26: error: expected ';' before ')' token
   12 |     for(i = 0; i < N, ++i){
      |                          ^
      |                          ;
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<math.h>
#include<comlex>
 
using namespace std;
int main() {
	double h[1000], m[1000], sum;
	double ans, n, t, a;
	cin >> n >> t >> a;
	for (int i = 0; i < n; i++) {
		cin >> h[i];
	}
	sum = abs((t - (h[0] * 0.006)) - a);
	ans = 1;
	for (int i = 0; i < n; i++) {
		m[i] = t - (h[i] * 0.006);
		if (sum > abs(m[i] - a))ans = i + 1;
	}
	cout << ans << endl;
	return 0;
}

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

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

const int INF = 1000000007;

int main () {

    int N, T, A;
    cin >> N;

    cin >> T >> A;

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

    int ans;
    int diff = INF;

    for (int i = 0; i < N; i++) {
        int temp = T - 0.006 * H[i];

        if (abs(temp - A) < diff) {
            ans = i + 1;
            diff = abs(temp - A);
        }
    cons << endl;
    ut << "diff = " << diff << endl;
        cout << "ans = " << ans << endl;
    }
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'cons' was not declared in this scope; did you mean 'cos'?
   28 |     cons << endl;
      |     ^~~~
      |     cos
a.cc:29:5: error: 'ut' was not declared in this scope
   29 |     ut << "diff = " << diff << endl;
      |     ^~
Language: C++

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

int main() {
  int N;
  double T, A;
  cin >> N >> T >> A;
  double H[N];
  for (int i = 0; i < N; i++) {
    cin >> H[i];
  }
  double mi = abs(A - (T - H[0] * 0.006));
  int place = 0;
  for (int i = 1; i < N; i++) {
    if (mi > abs(A - (T - H[i] * 0.006))) {
      mi    = abs(A - (T - H[i] * 0.006));
      place = i
    }
  }
  cout << place << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: expected ';' before '}' token
   18 |       place = i
      |                ^
      |                ;
   19 |     }
      |     ~
Language: C

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

int main(){
  int n; double a,t; cin >> n >>  a >> t;
  int ans = 0;
  double ans_d = 1000000000000000000.0;
  rep(i,n){
    int ii; cin >> ii;
    double Tx = t - ii*0.006;
    if(fabs(Tx - a) < fabs(ans_d - a)){
      ans_d = Tx;
      ans = i;
    }
  }
  cout << ans+1 << endl;
}

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

#include <iostream>

int main(void) {
  int n, t, a, h, r;
  double m, j;
  scanf("%d%d%d", &n, &t, &a);
  scanf("%d", &h);
  m = fabs((double)t - (double)h * 0.006);
  r = 1;
  for(int i = 0; i < n - 1; i++) {
    scanf("%d", &h);
    j = fabs((double)t - (double)h * 0.006);
    if(m > j) m = j, r = i + 2;
  }
  printf("%d\n",  r);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    8 |   m = fabs((double)t - (double)h * 0.006);
      |       ^~~~
      |       labs
Language: C++

#include <iostream>

int main(void) {
  int n, t, a, h, r;
  double m, j;
  scanf("%d%d%d", &n, &t, &a);
  scanf("%d", &h);
  m = fabs((double)t - (double)h * 0.006);
  r = 1;
  for(int i = 0; i < n - 1; i++) {
    scanf("%d", &h);
    j = fabs((double)t - (double)h * 0.006)
    if(m > j) m = j, r = i + 2;
  }
  printf("%d\n",  r);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    8 |   m = fabs((double)t - (double)h * 0.006);
      |       ^~~~
      |       labs
Language: C++

#include <stdio.h>
#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;


int main() {
	int N, T, A;
	cin >> N >> T >> A;
	vector<int> H(N);
	for (auto &x : H) cin >> x;
	auto minitr = min_element(H.begin(), H.end(), [&](int x, int y) {return fabs(T - x * 0.006 - A) < fabs(T - y * 0.006 - A); });
	cout << minitr - H.begin() + 1 << endl;
}

Compiler output:
a.cc: In lambda function:
a.cc:13:81: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   13 |         auto minitr = min_element(H.begin(), H.end(), [&](int x, int y) {return fabs(T - x * 0.006 - A) < fabs(T - y * 0.006 - A); });
      |                                                                                 ^~~~
      |                                                                                 labs
Language: C++

#include<stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: 'i' was not declared in this scope
   18 |                 if((x[k]>A?x[i]-A:A-x[i]) < (x[min]>A?x[min]-A:A-x[min])){
      |                              ^
Language: C++

#include<stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected initializer before 'int'
    5 |         int T , A;
      |         ^~~
a.cc:6:15: error: 'N' was not declared in this scope
    6 |         int H[N];
      |               ^
a.cc:7:29: error: 'T' was not declared in this scope
    7 |         scanf("%d%d%d",&N ,&T ,&A);
      |                             ^
a.cc:7:33: error: 'A' was not declared in this scope
    7 |         scanf("%d%d%d",&N ,&T ,&A);
      |                                 ^
a.cc:9:29: error: 'H' was not declared in this scope
    9 |                 scanf("%d",&H[i]);
      |                             ^
a.cc:15:17: error: 'x' was not declared in this scope
   15 |                 x[j] = 1000*T - 6*H[j];
      |                 ^
a.cc:15:35: error: 'H' was not declared in this scope
   15 |                 x[j] = 1000*T - 6*H[j];
      |                                   ^
a.cc:18:21: error: 'x' was not declared in this scope
   18 |                 if((x[k]>A?x[i]-A:A-x[i]) < (x[min]>A?x[min]-A:A-x[min])){
      |                     ^
a.cc:18:30: error: 'i' was not declared in this scope
   18 |                 if((x[k]>A?x[i]-A:A-x[i]) < (x[min]>A?x[min]-A:A-x[min])){
      |                              ^
Language: C++

#include<stdio.h>

int main(){
	int N;
	int T , A;
	int H[N];
	if(scanf("%d %d %d",&N ,&T ,&A))
	for(int i=0;i<N;i++){
		if(scanf("%d",&H[i]))
	}
	int x[N];
	for(int j=0;j<N;j++){
		x[j] = 1000*A - (1000*T - 6*H[j]);
		if(x[j]<0){
			x[j] *= -1;
		}
	}
	int min = 0;
	for(int k=1;k<N;k++){
		if(x[k] < x[min]){
			min = k;
		}
	}
	printf("%d\n",min+1);
	return 0;
}
		
		

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected primary-expression before '}' token
   10 |         }
      |         ^
Language: C++

#include<bits/stdc++.h>

int main(){
	int N;
	int T , A;
	int H[N];
	cin >> N >> T >> A;
	for(int i=0;i<N;i++){
		cin >> H[i];
	}
	int x[N];
	for(int j=0;j<N;j++){
		x[j] = 1000*A - (1000*T - 6*H[j]);
		if(x[j]<0){
			x[j] *= -1;
		}
	}
	int min = 0;
	for(int k=1;k<N;k++){
		if(x[k] < x[min]){
			min = k;
		}
	}
	cout << min+1 << endl;
	return 0;
}
		
		

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin >> N >> T >> A;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:24:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   24 |         cout << min+1 << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:24:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   24 |         cout << min+1 << endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<stdio.h>

int main(){
	int N;
	int T , A;
	int H[N];
	if(scanf("%d %d %d",&N ,&T ,&A);){}
	for(int i=0;i<N;i++){
		if(scanf("%d",&H[i]);){}
	}
	int x[N];
	for(int j=0;j<N;j++){
		x[j] = 1000*A - (1000*T - 6*H[j]);
		if(x[j]<0){
			x[j] *= -1;
		}
	}
	int min = 0;
	for(int k=1;k<N;k++){
		if(x[k] < x[min]){
			min = k;
		}
	}
	printf("%d\n",min+1);
	return 0;
}
		
		

Compiler output:
a.cc: In function 'int main()':
a.cc:7:41: error: expected primary-expression before ')' token
    7 |         if(scanf("%d %d %d",&N ,&T ,&A);){}
      |                                         ^
a.cc:9:38: error: expected primary-expression before ')' token
    9 |                 if(scanf("%d",&H[i]);){}
      |                                      ^
Language: C++

#include<stdio.h>

int main(){
	int N;
	int T , A;
	int H[N];
	if(scanf("%d %d %d",&N ,&T ,&A););
	for(int i=0;i<N;i++){
		if(scanf("%d",&H[i]););
	}
	int x[N];
	for(int j=0;j<N;j++){
		x[j] = 1000*A - (1000*T - 6*H[j]);
		if(x[j]<0){
			x[j] *= -1;
		}
	}
	int min = 0;
	for(int k=1;k<N;k++){
		if(x[k] < x[min]){
			min = k;
		}
	}
	printf("%d\n",min+1);
	return 0;
}
		
		

Compiler output:
a.cc: In function 'int main()':
a.cc:7:41: error: expected primary-expression before ')' token
    7 |         if(scanf("%d %d %d",&N ,&T ,&A););
      |                                         ^
a.cc:9:38: error: expected primary-expression before ')' token
    9 |                 if(scanf("%d",&H[i]););
      |                                      ^
Language: C++

#include<stdio.h>

int main(){
	int N;
	int T , A;
	int H[N];
	scanf("%d %d %d",N , T , A);
	for(int i=0;i<N;i++){
		scanf("%d",H[i]);
	}
	int x[N];
	for(int j=0;j<N;j++){
		x[j] = 1000*A - (1000*T - 6*H[j]);
		if(x[j]<0){
			x[j] *= -1;
		}
	}
	int min = 0;
	for(int k=1;k<N;k++){
		if(x[k] < x[min]){
			min = k;
		}
	}
	printf("%d\n",k+1);
	return 0;
}
		
		

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: 'k' was not declared in this scope
   24 |         printf("%d\n",k+1);
      |                       ^
Language: C

#include<stdio.h>
int main() {
	int a, b, c, d, e, f, g, h, o, k;
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);
	int g = 1000;
	int aa[a];
	for (int i = 0; i < a; i++){
		scanf("%d", &aa[i]);
		e = b - aa[i] * 6 / 1000;
		f = c - e;
		if (f < 0) f *= -1;
		if (f < g) f = g;
	}
	int h = 100;
	int m = 0;
	while (h == g){
		o = b - aa[m] * 6 / 1000;
		h = c - o;
		if (h < 0) h *= -1;
		m += 1;
	}
	printf("%d", m);
}

Compiler output:
main.c: In function 'main':
main.c:7:13: error: redeclaration of 'g' with no linkage
    7 |         int g = 1000;
      |             ^
main.c:3:31: note: previous declaration of 'g' with type 'int'
    3 |         int a, b, c, d, e, f, g, h, o, k;
      |                               ^
main.c:16:13: error: redeclaration of 'h' with no linkage
   16 |         int h = 100;
      |             ^
main.c:3:34: note: previous declaration of 'h' with type 'int'
    3 |         int a, b, c, d, e, f, g, h, o, k;
      |                                  ^