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

#include <iostream>
using namespace std;
int N,M,mn,mx;
int A(M);

int main(){
    cin >> N;
    M = N+1
    for (int j = 0; j < N; j++) cin >> A[j];
    mn=A[0],mx=A[0];
    for(int i=1;i<N;i++){
		if(mn>A[i])mn=A[i];
		if(mx<A[i])mx=A[i];
    }
    cout <<    mx-mn << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before 'for'
    8 |     M = N+1
      |            ^
      |            ;
    9 |     for (int j = 0; j < N; j++) cin >> A[j];
      |     ~~~     
a.cc:9:21: error: 'j' was not declared in this scope
    9 |     for (int j = 0; j < N; j++) cin >> A[j];
      |                     ^
a.cc:10:9: error: invalid types 'int[int]' for array subscript
   10 |     mn=A[0],mx=A[0];
      |         ^
a.cc:10:17: error: invalid types 'int[int]' for array subscript
   10 |     mn=A[0],mx=A[0];
      |                 ^
a.cc:12:24: error: invalid types 'int[int]' for array subscript
   12 |                 if(mn>A[i])mn=A[i];
      |                        ^
a.cc:12:32: error: invalid types 'int[int]' for array subscript
   12 |                 if(mn>A[i])mn=A[i];
      |                                ^
a.cc:13:24: error: invalid types 'int[int]' for array subscript
   13 |                 if(mx<A[i])mx=A[i];
      |                        ^
a.cc:13:32: error: invalid types 'int[int]' for array subscript
   13 |                 if(mx<A[i])mx=A[i];
      |                                ^
Language: C++

#include <iostream>
using namespace std;
int N,M,mn,mx;
int A[M];

int main(){
    cin >> N;
    M = N+1
    for (int j = 0; j < N; j++) cin >> A[j];
    mn=A[0],mx=A[0];
    for(int i=1;i<N;i++){
		if(mn>A[i])mn=A[i];
		if(mx<A[i])mx=A[i];
    }
    cout <<    mx-mn << endl;
}


Compiler output:
a.cc:4:7: error: size of array 'A' is not an integral constant-expression
    4 | int A[M];
      |       ^
a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before 'for'
    8 |     M = N+1
      |            ^
      |            ;
    9 |     for (int j = 0; j < N; j++) cin >> A[j];
      |     ~~~     
a.cc:9:21: error: 'j' was not declared in this scope
    9 |     for (int j = 0; j < N; j++) cin >> A[j];
      |                     ^
Language: C++

#include <iostream>
using namespace std;
int N,mn,mx;
int A[N];

int main(){
    cin >> N;
    for (int j = 0; j < N; j++) cin >> A[j];
    mn=A[0],mx=A[0];
    for(int i=1;i<N;i++){
		if(mn>A[i])mn=A[i];
		if(mx<A[i])mx=A[i];
    }
    cout <<    mx-mn << endl;
}


Compiler output:
a.cc:4:7: error: size of array 'A' is not an integral constant-expression
    4 | int A[N];
      |       ^
Language: C++

#include <iostream>
using namespace std;
int N,mn,mx;
int A[N+1];

int main(){
    cin >> N;
    for (int j = 0; j < N; j++) cin >> A[j];
    mn=A[0],mx=A[0];
    for(int i=1;i<N;i++){
		if(mn>A[i])mn=A[i];
		if(mx<A[i])mx=A[i];
    }
    cout <<    mx-mn << endl;
}

Compiler output:
a.cc:4:8: error: size of array 'A' is not an integral constant-expression
    4 | int A[N+1];
      |       ~^~
Language: C++

#include <iostream>
using namespace std;
int N,mn,mx;
int A[N+1];

int main(){
    cin >> N;
    for (int j = 0; j < N; ++j) cin >> A[j];
    mn=A[0],mx=A[0];
    for(int i=1;i<N;i++){
		if(mn>A[i])mn=A[i];
		if(mx<A[i])mx=A[i];
    }
    cout <<    mx-mn << endl;
}

Compiler output:
a.cc:4:8: error: size of array 'A' is not an integral constant-expression
    4 | int A[N+1];
      |       ~^~
Language: C++

#include <iostream>
using namespace std;
int N,mn,mx;
int A[N+1];

int main(){
    cin >> N;
    for (int j = 0; j < N; ++i) cin >> A[j];
    mn=A[0],mx=A[0];
    for(int i=1;i<N;i++){
		if(mn>A[i])mn=A[i];
		if(mx<A[i])mx=A[i];
    }
    cout <<    mx-mn << endl;
}


Compiler output:
a.cc:4:8: error: size of array 'A' is not an integral constant-expression
    4 | int A[N+1];
      |       ~^~
a.cc: In function 'int main()':
a.cc:8:30: error: 'i' was not declared in this scope
    8 |     for (int j = 0; j < N; ++i) cin >> A[j];
      |                              ^
Language: C++

#include <iostream>
using namespace std;
int N;
int A[N+1];

int main(){
    cin >> N;
    for (int j = 0; j < N; ++i) cin >> A[j];
    int min=A[0],max=A[0];
    for(int i=1;i<N;i++){
		if(min>A[i])
			min=A[i];
		if(max<A[i])
			max=A[i];
    }
    cout <<    max-min << endl;
}


Compiler output:
a.cc:4:8: error: size of array 'A' is not an integral constant-expression
    4 | int A[N+1];
      |       ~^~
a.cc: In function 'int main()':
a.cc:8:30: error: 'i' was not declared in this scope
    8 |     for (int j = 0; j < N; ++i) cin >> A[j];
      |                              ^
Language: C++

#include <iostream>
using namespace std;
int N;
int A[N+1];

int main(){
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> A[i];
    int min=A[0],max=A[0];
    for(int i=1;i<N;i++){
		if(min>A[i])
			min=A[i];
		if(max<A[i])
			max=A[i];
    }
    cout <<    max-min << endl;
}


Compiler output:
a.cc:4:8: error: size of array 'A' is not an integral constant-expression
    4 | int A[N+1];
      |       ~^~
Language: C++

#include <iostream>
using namespace std;
int N;
int A[N+1];

int main(){
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> A[i];
    int min=A[0],max=A[0];
    for(int i=1;i<n;i++){
		if(min>A[i])
			min=A[i];
		if(max<A[i])
			max=A[i];
    }
    cout <<    max-min << endl;
}

Compiler output:
a.cc:4:8: error: size of array 'A' is not an integral constant-expression
    4 | int A[N+1];
      |       ~^~
a.cc: In function 'int main()':
a.cc:10:19: error: 'n' was not declared in this scope
   10 |     for(int i=1;i<n;i++){
      |                   ^
Language: C++

#include <iostream>
using namespace std;
int N;
int A[N+1];

int main(){
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> A[i];
    int min=A[0],max=A[0];
    for(int i=1;i<n;i++){
		if(min>a[i])
			mn=a[i];
		if(max<a[i])
			mx=a[i];
    }
    cout <<    max-min << endl;
}

Compiler output:
a.cc:4:8: error: size of array 'A' is not an integral constant-expression
    4 | int A[N+1];
      |       ~^~
a.cc: In function 'int main()':
a.cc:10:19: error: 'n' was not declared in this scope
   10 |     for(int i=1;i<n;i++){
      |                   ^
a.cc:11:24: error: 'a' was not declared in this scope
   11 |                 if(min>a[i])
      |                        ^
a.cc:12:25: error: 'mn' was not declared in this scope; did you mean 'min'?
   12 |                         mn=a[i];
      |                         ^~
      |                         min
a.cc:13:24: error: 'a' was not declared in this scope
   13 |                 if(max<a[i])
      |                        ^
a.cc:14:25: error: 'mx' was not declared in this scope; did you mean 'max'?
   14 |                         mx=a[i];
      |                         ^~
      |                         max
Language: C++

;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#define all(x) (x).begin(),(x).end()

void solve(){

}
int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++){
        cin >> a[i];
    }
    sort(all(a));
    cout << a[(int)a.size()-1] - a[0] << endl;


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   25 |     cin >> N;
      |     ^~~
      |     std::cin
In file included from a.cc:6:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:26:5: error: 'vector' was not declared in this scope
   26 |     vector<int> a(N);
      |     ^~~~~~
a.cc:26:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:10:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:26:12: error: expected primary-expression before 'int'
   26 |     vector<int> a(N);
      |            ^~~
a.cc:28:16: error: 'a' was not declared in this scope
   28 |         cin >> a[i];
      |                ^
a.cc:30:14: error: 'a' was not declared in this scope
   30 |     sort(all(a));
      |              ^
a.cc:18:17: note: in definition of macro 'all'
   18 | #define all(x) (x).begin(),(x).end()
      |                 ^
a.cc:30:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   30 |     sort(all(a));
      |     ^~~~
      |     std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:9:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:31:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |     cout << a[(int)a.size()-1] - a[0] << 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:31:42: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   31 |     cout << a[(int)a.size()-1] - a[0] << endl;
      |                                          ^~~~
      |                                          std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cassert>
#include <memory>
#include <stack>
#include <set>

#define MAX_SIZE 100000000
typedef unsigned long long ull;
using namespace std;

int main() {
  int N; cin >> N;
  int imax = INT_MIN;
  int imin = INT_MAX;
  for(int i = 0; i < N; i++) {
    int e; cin >> e;
    imax = max(imax, e);
    imin = min(imin, e);
  }
  int ans = abs(imax - imin);
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: 'INT_MIN' was not declared in this scope
   25 |   int imax = INT_MIN;
      |              ^~~~~~~
a.cc:18:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   17 | #include <set>
  +++ |+#include <climits>
   18 | 
a.cc:26:14: error: 'INT_MAX' was not declared in this scope
   26 |   int imin = INT_MAX;
      |              ^~~~~~~
a.cc:26:14: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cassert>
#include <memory>
#include <stack>
#include <set>

#define MAX_SIZE 100000000
typedef unsigned long long ull;
using namespace std;

int main() {
  int N; cin >> N;
  int imax(INT_MIN);
  int imin(INT_MAX);
  for(int i = 0; i < N; i++) {
    int e; cin >> e;
    imax = max(imax, e);
    imin = min(imin, e);
  }
  int ans = abs(imax - imin);
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: 'INT_MIN' was not declared in this scope
   25 |   int imax(INT_MIN);
      |            ^~~~~~~
a.cc:18:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   17 | #include <set>
  +++ |+#include <climits>
   18 | 
a.cc:26:12: error: 'INT_MAX' was not declared in this scope
   26 |   int imin(INT_MAX);
      |            ^~~~~~~
a.cc:26:12: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include<iostream>
using namespace std;

int main()
{
	int n,a[100];
	cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	
	cout<<*max_element(&a[0],&a[n])-*min_element(&a[0],&a[n])<<endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 'max_element' was not declared in this scope
   10 |         cout<<*max_element(&a[0],&a[n])-*min_element(&a[0],&a[n])<<endl;
      |                ^~~~~~~~~~~
a.cc:10:42: error: 'min_element' was not declared in this scope
   10 |         cout<<*max_element(&a[0],&a[n])-*min_element(&a[0],&a[n])<<endl;
      |                                          ^~~~~~~~~~~
Language: C++

#include <iostream>

use namespace std;

int main() {
  int i, n[];
  cin >> i;
  int min = 1000000000, max = 0;
  for(;i > 0; --i) {
    cin >> n[i];
    if(n[i] > max) max = n[i];
    if(n[i] < min) min = n[i];
  }
  cout << max - min << endl;
}
    
  

Compiler output:
a.cc:3:1: error: 'use' does not name a type
    3 | use namespace std;
      | ^~~
a.cc: In function 'int main()':
a.cc:6:10: error: storage size of 'n' isn't known
    6 |   int i, n[];
      |          ^
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> i;
      |   ^~~
      |   std::cin
In file included 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:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout << max - min << 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:14:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |   cout << max - min << endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;

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

vector<int> a(N);
for(int i =0;i<n;i++)
cin >> a[i];

int min=a[0],max=a[0];
for(int i = 1;i<n;i++){
if(max<a[i]){
max=a[i];
}
if(min>a[i]){
min=a[i];
}
}
cout << max-min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'vector' was not declared in this scope
    8 | vector<int> a(N);
      | ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:8: error: expected primary-expression before 'int'
    8 | vector<int> a(N);
      |        ^~~
a.cc:9:16: error: 'n' was not declared in this scope
    9 | for(int i =0;i<n;i++)
      |                ^
a.cc:10:8: error: 'a' was not declared in this scope
   10 | cin >> a[i];
      |        ^
a.cc:12:9: error: 'a' was not declared in this scope
   12 | int min=a[0],max=a[0];
      |         ^
a.cc:13:17: error: 'n' was not declared in this scope
   13 | for(int i = 1;i<n;i++){
      |                 ^
a.cc:14:4: error: parse error in template argument list
   14 | if(max<a[i]){
      |    ^~~~~~~~
a.cc:14:12: error: cannot resolve overloaded function 'max' based on conversion to type 'bool'
   14 | if(max<a[i]){
      |            ^
a.cc:21:12: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   21 | cout << max-min << endl;
      |         ~~~^~~~
Language: C++

#include<iostream>
using namespace std;

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

vector<int> a(N);
for(int i =0;i<a;i++)
cin >> a[i];

int min=a[0],max=a[0];
for(int i = 1;i<a;i++){
if(max>a[i]){
max=a[i];
}
if(min>a[i]){
min=a[i];
}
}
cout << max-min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'vector' was not declared in this scope
    8 | vector<int> a(N);
      | ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:8: error: expected primary-expression before 'int'
    8 | vector<int> a(N);
      |        ^~~
a.cc:9:16: error: 'a' was not declared in this scope
    9 | for(int i =0;i<a;i++)
      |                ^
a.cc:12:9: error: 'a' was not declared in this scope
   12 | int min=a[0],max=a[0];
      |         ^
a.cc:21:12: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   21 | cout << max-min << endl;
      |         ~~~^~~~
Language: C++

#include<iostream>
using namespace std;

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

vecter<int> a(N);
for(int i =0;i<a;i++)
cin >> a[i];

int min=a[0],max=a[0];
for(int i = 1;i<a;i++){
if(max>a[i]){
max=a[i];
}
if(min>a[i]){
min=a[i];
}
}
cout << max-min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'vecter' was not declared in this scope
    8 | vecter<int> a(N);
      | ^~~~~~
a.cc:8:8: error: expected primary-expression before 'int'
    8 | vecter<int> a(N);
      |        ^~~
a.cc:9:16: error: 'a' was not declared in this scope
    9 | for(int i =0;i<a;i++)
      |                ^
a.cc:12:9: error: 'a' was not declared in this scope
   12 | int min=a[0],max=a[0];
      |         ^
a.cc:21:12: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   21 | cout << max-min << endl;
      |         ~~~^~~~
Language: C++

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

vector<int> input(int n)
{
	int i;
	vector<int> ret(n);
	for (i = 0; i < n; i++) {
		cin >> ret[i];
	}

	return ret;
}

int main(int argc, char *argv[])
{
	int n;
	int max, min;
	vector<int> array;
	cin >> n;

	array = input(n);

	max = max_element(array.begin(), array.end());
	min = min_element(array.begin(), array.end());

	cout << max - min << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:28:26: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   28 |         max = max_element(array.begin(), array.end());
      |               ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          |
      |                          __gnu_cxx::__normal_iterator<int*, std::vector<int> >
a.cc:29:26: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   29 |         min = min_element(array.begin(), array.end());
      |               ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          |
      |                          __gnu_cxx::__normal_iterator<int*, std::vector<int> >
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[] A = new int[N];
    
    for(int i=0; i<N-1;i++){
      
      A[i]=sc.nextInt();
    }
    
    Arrays.sort(A);
    
    int diff = abs(A[N-1]-A[0]);
    
    System.out.println(diff);
  }
}


Compiler output:
Main.java:18: error: cannot find symbol
    int diff = abs(A[N-1]-A[0]);
               ^
  symbol:   method abs(int)
  location: class Main
1 error
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 min=1;
    int max 100000000;
    
    for(int i ; i < N; i++){
      int A = sc.nextInt();
      min = Math.min(min, A);
      max = Math.max(max, A);
     
    }
    System.out.println(abs(max-min));
  }
}

    
    print
  }

Compiler output:
Main.java:11: error: ';' expected
    int max 100000000;
           ^
Main.java:24: error: class, interface, enum, or record expected
    print
    ^
2 errors
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++)
    cin >> A.at(i);
  sort(A.begin(), A.end());
  int min = A.at(0);
  reverse(A.begin(), A.end());
  int max = A.at(0);
  cout << max - min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> A(N);
      |          ^~~
a.cc:9:12: error: 'A' was not declared in this scope
    9 |     cin >> A.at(i);
      |            ^
a.cc:10:8: error: 'A' was not declared in this scope
   10 |   sort(A.begin(), A.end());
      |        ^
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(A.begin(), A.end());
      |   ^~~~
      |   short
a.cc:12:3: error: 'reverse' was not declared in this scope
   12 |   reverse(A.begin(), A.end());
      |   ^~~~~~~
Language: C++

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

int main(){
  int n;
  int a, max, min;
  nummax = 1;
  nummin = 1e9;
  cin >> n;
  
  for ( int i = 0; i < n; i++ ){
    cin >> a;
    nummax = max(nummax, a);
    nummin = min(nummin, a);
  }
  
  cout << nummax - nummin << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'nummax' was not declared in this scope
    8 |   nummax = 1;
      |   ^~~~~~
a.cc:9:3: error: 'nummin' was not declared in this scope
    9 |   nummin = 1e9;
      |   ^~~~~~
a.cc:14:17: error: 'max' cannot be used as a function
   14 |     nummax = max(nummax, a);
      |              ~~~^~~~~~~~~~~
a.cc:15:17: error: 'min' cannot be used as a function
   15 |     nummin = min(nummin, a);
      |              ~~~^~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n;
  int a, max, min;
  nummax = 1;
  nummin = 1e9;
  cin >> n;
  
  for ( int i = 0; i < n; i++ ){
    cin >> a;
    nummax = max(nummax, a);
    nummin = min(nummin, a);
  }
  
  cout << nummax - nummin << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'nummax' was not declared in this scope
    7 |   nummax = 1;
      |   ^~~~~~
a.cc:8:3: error: 'nummin' was not declared in this scope
    8 |   nummin = 1e9;
      |   ^~~~~~
a.cc:13:17: error: 'max' cannot be used as a function
   13 |     nummax = max(nummax, a);
      |              ~~~^~~~~~~~~~~
a.cc:14:17: error: 'min' cannot be used as a function
   14 |     nummin = min(nummin, a);
      |              ~~~^~~~~~~~~~~
Language: C++

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

int main(){
   int n;
   cin >> n;
   int A[n];
   for (int i=0; i<n; i++)
      cin >> A[i]
   int max = A[0], min = A[0];
   for ( int i=0; i<n; i++){
      if ( max < A[i] ) max = A[i];
      if ( min > A[i] ) min = A[i];
      }
   cout << max - min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before 'int'
    9 |       cin >> A[i]
      |                  ^
      |                  ;
   10 |    int max = A[0], min = A[0];
      |    ~~~            
a.cc:12:12: error: parse error in template argument list
   12 |       if ( max < A[i] ) max = A[i];
      |            ^~~~~~~~~~
a.cc:12:23: error: cannot resolve overloaded function 'max' based on conversion to type 'bool'
   12 |       if ( max < A[i] ) max = A[i];
      |                       ^
a.cc:12:34: error: overloaded function with no contextual type information
   12 |       if ( max < A[i] ) max = A[i];
      |                                  ^
a.cc:13:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
   13 |       if ( min > A[i] ) min = A[i];
      |            ~~~~^~~~~~
a.cc:13:34: error: overloaded function with no contextual type information
   13 |       if ( min > A[i] ) min = A[i];
      |                                  ^
a.cc:15:16: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator-'
   15 |    cout << max - min << endl;
      |            ~~~~^~~~~
Language: C++

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

int main(){
   int n;
   cin >> n;
   int A[n];
   for ( i=0; i<n; i++)
      cin >> A[i]
   int max = A[0], min = A[0];
   for ( int i=0; i<n; i++){
      if ( max < A[i] ) max = A[i];
      if ( min > A[i] ) min = A[i];
      }
   cout << max - min << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'i' was not declared in this scope
    8 |    for ( i=0; i<n; i++)
      |          ^
a.cc:12:12: error: parse error in template argument list
   12 |       if ( max < A[i] ) max = A[i];
      |            ^~~~~~~~~~
a.cc:12:23: error: cannot resolve overloaded function 'max' based on conversion to type 'bool'
   12 |       if ( max < A[i] ) max = A[i];
      |                       ^
a.cc:12:34: error: overloaded function with no contextual type information
   12 |       if ( max < A[i] ) max = A[i];
      |                                  ^
a.cc:13:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
   13 |       if ( min > A[i] ) min = A[i];
      |            ~~~~^~~~~~
a.cc:13:34: error: overloaded function with no contextual type information
   13 |       if ( min > A[i] ) min = A[i];
      |                                  ^
a.cc:15:16: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator-'
   15 |    cout << max - min << endl;
      |            ~~~~^~~~~
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[] numlist = new int[N];
    
    for(int i=0;i<N;i++){
      numlist[i]=sc.nextInt();
    }
    numlist.sort();
    
    int diff=numlist[N-1]-numlist[0];
    
    System.out.println(diff);
  }
}

    

Compiler output:
Main.java:12: error: cannot find symbol
    numlist.sort();
           ^
  symbol:   method sort()
  location: variable numlist of type int[]
1 error
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[] numlist = int[N];
    
    for(int i=0;i<N;i++){
      numlist[i]=sc.nextInt();
    }
    numlist.sort();
    
    int diff=numlist[N-1]-numlist[0];
    
    System.out.println(diff);
  }
}

    

Compiler output:
Main.java:3: error: '{' expected
public class Main(){
                 ^
Main.java:7: error: ']' expected
    int[] numlist = int[N];
                        ^
Main.java:7: error: ';' expected
    int[] numlist = int[N];
                         ^
3 errors
Language: C++

#include<iostream>
using namespace std;

int main() {
	int N;
	std::cin >> N;
	int * A= new int[N];
	memset(A, 0, sizeof(A));
	int max = 0, min = 0;
	for (int i=1; i > N; ++i) {
		std::cin >> A[i];
		if (A[i] > max)max = A[i];
		if (A[i] < min)min = A[i];
	}
	int ans = max - min;
	std::cout << ans;
	delete A;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'memset' was not declared in this scope
    8 |         memset(A, 0, sizeof(A));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

include<iostream>
using namespace std;

int main() {
	int N;
	std::cin >> N;
	int * A= new int[N];
	int max = 0, min = 0;
	for (int i=1; i > N; ++i) {
		std::cin >> A[i];
		if (A[i] > max)max = A[i];
		if (A[i] < min)min = A[i];
	}
	int ans = max - min;
	std::cout << ans;
	delete A;
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:14: error: 'cin' is not a member of 'std'
    6 |         std::cin >> N;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | include<iostream>
a.cc:10:22: error: 'cin' is not a member of 'std'
   10 |                 std::cin >> A[i];
      |                      ^~~
a.cc:10:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:14: error: 'cout' is not a member of 'std'
   15 |         std::cout << ans;
      |              ^~~~
a.cc:15:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	int N;
	int A[N];
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	sort(A.begin(), A.end());
	cout << A[N - 1] - A[0] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: request for member 'begin' in 'A', which is of non-class type 'int [N]'
   10 |         sort(A.begin(), A.end());
      |                ^~~~~
a.cc:10:27: error: request for member 'end' in 'A', which is of non-class type 'int [N]'
   10 |         sort(A.begin(), A.end());
      |                           ^~~
Language: C

#include <stdio.h>

int main(void) {
	int n,min=1000000001,max=0;
	int a[101];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		if(min>a[i]){
			min=a[i];
		}
		if(max<a[i]){
			max=a[i];
		}
	}
	printf("%d",max-min);
	return 0;
}


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

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

int main() {
  int N;
  cin>>N;
  
  int a[110];
  for(int i=0;i<N;++i){
    cin>>a[i];
  }
  
  int Max=0;
  int Min=1000000;
  for(int i=0;i<N;++i){
    Max=max(Max,a[i]);
    Min=min(Min,a[i]);
  }
  
  
  cout<<max-min<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator-'
   23 |   cout<<max-min<<endl;
      |         ~~~^~~~
Language: C++

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

int main() {
  int N;
  cin>>N;
  
  int a[110];
  for(int i=0;i<N;++i){
    cin>>a[i];
  }
  
  int max=0;
  int min=1000000;
  for(int i=0;i<N;++i){
    max=max(max,a[i]);
    min=min(min,a[i]);
  }
  
  
  cout<<max-min<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: 'max' cannot be used as a function
   18 |     max=max(max,a[i]);
      |         ~~~^~~~~~~~~~
a.cc:19:12: error: 'min' cannot be used as a function
   19 |     min=min(min,a[i]);
      |         ~~~^~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
  int N; cin >> N;
  int a[N];
  for(int i = 0;i < N;++i) {
    cin >> a[i];
  }
  int b = *max_element(a.begin(), a.end());
  int c = *min_element(a.begin(), a.end());
  int d = b - c;
  cout << d << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: request for member 'begin' in 'a', which is of non-class type 'int [N]'
   12 |   int b = *max_element(a.begin(), a.end());
      |                          ^~~~~
a.cc:12:37: error: request for member 'end' in 'a', which is of non-class type 'int [N]'
   12 |   int b = *max_element(a.begin(), a.end());
      |                                     ^~~
a.cc:13:26: error: request for member 'begin' in 'a', which is of non-class type 'int [N]'
   13 |   int c = *min_element(a.begin(), a.end());
      |                          ^~~~~
a.cc:13:37: error: request for member 'end' in 'a', which is of non-class type 'int [N]'
   13 |   int c = *min_element(a.begin(), a.end());
      |                                     ^~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  int N; cin >> N;
  int a[N];
  for(int i = 0;i < N;++i) {
    cin >> a[i];
  }
  int b = *max_element(a.begin(), a.end());
  int c = *min_element(a.begin(), a.end());
  int d = b - c;
  cout << d << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: request for member 'begin' in 'a', which is of non-class type 'int [N]'
   11 |   int b = *max_element(a.begin(), a.end());
      |                          ^~~~~
a.cc:11:37: error: request for member 'end' in 'a', which is of non-class type 'int [N]'
   11 |   int b = *max_element(a.begin(), a.end());
      |                                     ^~~
a.cc:12:26: error: request for member 'begin' in 'a', which is of non-class type 'int [N]'
   12 |   int c = *min_element(a.begin(), a.end());
      |                          ^~~~~
a.cc:12:37: error: request for member 'end' in 'a', which is of non-class type 'int [N]'
   12 |   int c = *min_element(a.begin(), a.end());
      |                                     ^~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  int N; cin >> N;
  int a[N];
  for(int i = 0;i < N;++i) {
    cin >> a[i];
    int b = *max_element(a[]);
    int c = *min_element(a[]);
    int d = b -c;
  }
  cout << d << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: expected primary-expression before ']' token
   10 |     int b = *max_element(a[]);
      |                            ^
a.cc:11:28: error: expected primary-expression before ']' token
   11 |     int c = *min_element(a[]);
      |                            ^
a.cc:14:11: error: 'd' was not declared in this scope
   14 |   cout << d << endl;
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int N; cin >> N;
  int a[N];
  for(int i = 0;i < N;++i) {
    cin >> a[i];
    int b = *max_element(a[]);
    int c = *min_element(a[]);
    int d = b -c;
  }
  cout << d << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: expected primary-expression before ']' token
    9 |     int b = *max_element(a[]);
      |                            ^
a.cc:9:14: error: 'max_element' was not declared in this scope
    9 |     int b = *max_element(a[]);
      |              ^~~~~~~~~~~
a.cc:10:28: error: expected primary-expression before ']' token
   10 |     int c = *min_element(a[]);
      |                            ^
a.cc:10:14: error: 'min_element' was not declared in this scope
   10 |     int c = *min_element(a[]);
      |              ^~~~~~~~~~~
a.cc:13:11: error: 'd' was not declared in this scope
   13 |   cout << d << endl;
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int N; cin >> N;
  int a[N];
  for(int i = 0;i < N;++i) cin >> a[i];
  int b = *max_element(a);
  int c = *min_element(a);
  int d = b -c;
  cout << d << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'max_element' was not declared in this scope
    8 |   int b = *max_element(a);
      |            ^~~~~~~~~~~
a.cc:9:12: error: 'min_element' was not declared in this scope
    9 |   int c = *min_element(a);
      |            ^~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int N, A[110];
	int mx, mn;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	sort(A.begin(), A.end());
	cout << A[N - 1] - A[0] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: request for member 'begin' in 'A', which is of non-class type 'int [110]'
   10 |         sort(A.begin(), A.end());
      |                ^~~~~
a.cc:10:27: error: request for member 'end' in 'A', which is of non-class type 'int [110]'
   10 |         sort(A.begin(), A.end());
      |                           ^~~
Language: C++

#include<iostream>
using namespace std;
int main() {
	int N, A[110];
	int mx, mn;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		mx = A[0];
		mn = A[0];
		for (int i = 0; i < N; i++) {
			mx = max(A[i], mx);
		}
		for (int i = 0; i < N; i++) {
			mn = min(A[i], mn);
		}
		cout << mx - mn << endl;
}


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

#include<iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  for(int i=0; i<N; i++){
    cin >> a.at(i);
  }
  int ma = 0;
  for(int i=0; i<N; i++){
    for(int j=0; j<N; j++){
      ma = max(ma,abs(a.at(i)-a.at(j)));
    }
  }
  cout << ma << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> a(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> a(N);
      |          ^~~
a.cc:8:12: error: 'a' was not declared in this scope
    8 |     cin >> a.at(i);
      |            ^
a.cc:13:23: error: 'a' was not declared in this scope
   13 |       ma = max(ma,abs(a.at(i)-a.at(j)));
      |                       ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  int a[102];
  for(int i = 0;i < N;++i) cin >> a[i];
  int A = 0;
  for(int i = 0;i < N;++i){
  for(int j = 0;j < N;++j) {
    int B = a[i] - a[j];
    int answer = max(A,B);
  }
 }
  cout << answer << endl;
}
    

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

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  int a[102];
  for(int i = 0;i < N;++i) cin >> a[i];
  int A = 0;
  for(int i = 0;i < N;++i){
  for(int j = 0;j < N;++j) {
    int answer = max(a,a[i] -a[j]);
  }
 }
  cout << answer << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: no matching function for call to 'max(int [102], int)'
   12 |     int answer = max(a,a[i] -a[j]);
      |                  ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:12:21: note:   deduced conflicting types for parameter 'const _Tp' ('int [102]' and 'int')
   12 |     int answer = max(a,a[i] -a[j]);
      |                  ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
a.cc:15:11: error: 'answer' was not declared in this scope
   15 |   cout << answer << endl;
      |           ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  int a[102];
  for(int i = 0;i < N;++i) cin >> a[i];
  int A = 0;
  for(int i = 0;i < N;++i){
  for(int j = 0;j < N;++j) {
    int answer = max(a,a[i] -a[j])
  }
 }
  cout << answer << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: no matching function for call to 'max(int [102], int)'
   12 |     int answer = max(a,a[i] -a[j])
      |                  ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:12:21: note:   deduced conflicting types for parameter 'const _Tp' ('int [102]' and 'int')
   12 |     int answer = max(a,a[i] -a[j])
      |                  ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
a.cc:15:11: error: 'answer' was not declared in this scope
   15 |   cout << answer << endl;
      |           ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  int a[102];
  for(int i = 0;i < N;++i) cin >> a[i];
  int a = 0;
  for(int i = 0;i < N;++i){
  for(int j = 0;j < N;++j) {
    int answer = max(a,a[i] -a[j])
  }
 }
  cout << answer << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: conflicting declaration 'int a'
    9 |   int a = 0;
      |       ^
a.cc:7:7: note: previous declaration as 'int a [102]'
    7 |   int a[102];
      |       ^
a.cc:12:21: error: no matching function for call to 'max(int [102], int)'
   12 |     int answer = max(a,a[i] -a[j])
      |                  ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:12:21: note:   deduced conflicting types for parameter 'const _Tp' ('int [102]' and 'int')
   12 |     int answer = max(a,a[i] -a[j])
      |                  ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
a.cc:15:11: error: 'answer' was not declared in this scope
   15 |   cout << answer << endl;
      |           ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  const int INF = 10000000;
  int N;
  cin >> N;
  int a[102];
  for(int i = 0;i < N;++i) cin >> a[i];
  int res = INF;
  int tes = -INF;
  for(int j = 0;j < N;++j) {
    if(a[i] < res) res = a[i];
    if(a[i] > tes) tes = a[i];
  }
  cout << tes - res << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: 'i' was not declared in this scope
   13 |     if(a[i] < res) res = a[i];
      |          ^
a.cc:14:10: error: 'i' was not declared in this scope
   14 |     if(a[i] > tes) tes = a[i];
      |          ^
Language: C++

#iclude <iostream>
using namespace std;

int main() {
  const int INF = 10000000;
  int N;
  cin >> N;
  int a[102];
  for(int i = 0;i < N;++i) cin >> a[i];
  int res = INF;
  int tes = -INF;
  for(int j = 0;j < N;++j) {
    if(a[i] < res) res = a[i];
    if(a[i] > tes) tes = a[i];
  }
  cout << tes - res << endl;
}
    

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude <iostream>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> N;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #iclude <iostream>
a.cc:13:10: error: 'i' was not declared in this scope
   13 |     if(a[i] < res) res = a[i];
      |          ^
a.cc:14:10: error: 'i' was not declared in this scope
   14 |     if(a[i] > tes) tes = a[i];
      |          ^
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout << tes - res << endl;
      |   ^~~~
a.cc:16:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:24: error: 'endl' was not declared in this scope
   16 |   cout << tes - res << endl;
      |                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #iclude <iostream>
Language: C++

#iclude <iostream>
using namespace std;

int main() {
  const int INF = 10000000;
  int N;
  cin >> N;
  int a[102];
  for(int i = 0;i < N;++i) cin >> a[i];
  int res = INF;
  int tes = -INT;
  for(int j = 0;j < N;++j) {
    if(a[i] < res) res = a[i];
    if(a[i] > tes) tes = a[i];
  }
  cout << tes - res << endl;
}
    

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude <iostream>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> N;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #iclude <iostream>
a.cc:11:14: error: 'INT' was not declared in this scope; did you mean 'INF'?
   11 |   int tes = -INT;
      |              ^~~
      |              INF
a.cc:13:10: error: 'i' was not declared in this scope
   13 |     if(a[i] < res) res = a[i];
      |          ^
a.cc:14:10: error: 'i' was not declared in this scope
   14 |     if(a[i] > tes) tes = a[i];
      |          ^
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout << tes - res << endl;
      |   ^~~~
a.cc:16:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:24: error: 'endl' was not declared in this scope
   16 |   cout << tes - res << endl;
      |                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #iclude <iostream>