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

    #include<stdio.h>
     
    int main(){
     
      int n,i;
      int a;
      int max=0;
      int min=1000000000;
      scanf("%d",&n);
      for(i=0;i<n;i++){
        scanf("%d",&a);
        if(max<a)max=a;
        if(min>a)min=a;
      }
      
      printf("%d\n",max-min);
     
      return 0;
    }

#include<stdio.h>

int main(){

  int n,i;
  int a;
  int max=0;
  int min=1000000000;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    if(max<a)max=a;
    if(min>a)min=a;
  }
  
  printf("%d\n",max-min);

  return 0;
}



Compiler output:
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main(){
      |     ^~~~
a.cc:3:9: note: 'int main()' previously defined here
    3 |     int main(){
      |         ^~~~
Language: C++

#include <iostream>

int main(){
    int n;
    int a[100];

    int mini, maxi;

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

    if (a[0] < a[1]){
        mini = a[0];
        maxi = a[1];
    }else{
        mini = a[1];
        maxi = a[0]
    }

    for(int i = 2; i < n; i++){
        if (a[i] < mini){
            mini = a[i];
        }
        if (a[i] > maxi){
            maxi = a[i];
        }
    }
    cout << maxi - mini;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |     cin >> n;
      |     ^~~
      |     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:19:20: error: expected ';' before '}' token
   19 |         maxi = a[0]
      |                    ^
      |                    ;
   20 |     }
      |     ~               
a.cc:30:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   30 |     cout << maxi - mini;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

#include <stdio.h>

int asc(const void *a, const void *b) {
  long long int *A = (long long int*)a;
  long long int *B = (long long int*)b;
  if (*A > *B) return 1;
  if (*A < *B) return -1;
  return 0;
}

int main() {

	int N, i;
	long long int *A;

	scanf("%d", &N);
	A = (*long long int)malloc(sizeof(long long int) * N);
	for(i = 0;i < N;i++) {
		scanf("%lld", &A[i]);
	}
	qsort(A, N, sizeof(long long int), asc);
	printf("%lld", A[N - 1] - A[0]);
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:17:15: error: expected expression before 'long'
   17 |         A = (*long long int)malloc(sizeof(long long int) * N);
      |               ^~~~
main.c:17:29: error: expected ';' before 'malloc'
   17 |         A = (*long long int)malloc(sizeof(long long int) * N);
      |                             ^~~~~~
      |                             ;
main.c:21:9: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   21 |         qsort(A, N, sizeof(long long int), asc);
      |         ^~~~~
Language: C

#include <stdio.h>

int asc(const void *a, const void *b) {
  long *A = (long long int*)a;
  long *B = (long long int*)b;
  if (*A > *B) return 1;
  if (*A < *B) return -1;
  return 0;
}

int main() {

	int N, i;
	long long int *A;

	scanf("%d", &N);
	A = (*long long int)malloc(sizeof(long long int) * N);
	for(i = 0;i < N;i++) {
		scanf("%lld", &A[i]);
	}
	qsort(A, N, sizeof(long long int), asc);
	printf("%lld", A[N - 1] - A[0]);
	return 0;
}



Compiler output:
main.c: In function 'asc':
main.c:4:13: error: initialization of 'long int *' from incompatible pointer type 'long long int *' [-Wincompatible-pointer-types]
    4 |   long *A = (long long int*)a;
      |             ^
main.c:5:13: error: initialization of 'long int *' from incompatible pointer type 'long long int *' [-Wincompatible-pointer-types]
    5 |   long *B = (long long int*)b;
      |             ^
main.c: In function 'main':
main.c:17:15: error: expected expression before 'long'
   17 |         A = (*long long int)malloc(sizeof(long long int) * N);
      |               ^~~~
main.c:17:29: error: expected ';' before 'malloc'
   17 |         A = (*long long int)malloc(sizeof(long long int) * N);
      |                             ^~~~~~
      |                             ;
main.c:21:9: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   21 |         qsort(A, N, sizeof(long long int), asc);
      |         ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
long int mx=-1,mn=100005;
cin>>n;
for(int i=0;i<n;i++) {
  cin>>a;
mx=max(mx,a);
mn=min(mn,a);
}
cout<<abs(mx-mn)<<endl;
}

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

import lava.util.*;

class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N=sc.nextInt();
int a1=sc.nextInt();
int max=a1;
int min=a1;
for(int i=2;i<=N;i++){
  int a = sc.nextInt();
if(max<a)
max=a;
if(min>a)
min=a;
}
System.out.println(max-min);
}
}


Compiler output:
Main.java:1: error: package lava.util does not exist
import lava.util.*;
^
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
                 ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: Java

import lava.util.*;

class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N=sc.nextInt();
int a1=sc.nextInt();
int max=a1;
int min=a1;
for(int i=2;i<=N;i++){
  int a = sc.nextInt();
if(max<a)
max=a;
if(min>a)
min=a;
}
}
}


Compiler output:
Main.java:1: error: package lava.util does not exist
import lava.util.*;
^
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
                 ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int max = 0;
  int min = INT_MAX;
  cin >> N;
  int tmp;
  for(int i = 0; i < N; i++){
    cin >> tmp;
    if(max < A) max = tmp;
    if(min > A) min = tmp;
  }
  cout << max - min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'A' was not declared in this scope
   12 |     if(max < A) max = tmp;
      |              ^
a.cc:13:14: error: 'A' was not declared in this scope
   13 |     if(min > A) min = tmp;
      |              ^
Language: C++

#include<iostream>
using namespace std;
inr n,a[111],i,j,ans;
int main(){
  cin>>n;
  for(i=1;i<=n;i++)
    cin>>a[i];
  for(i=1;i<=n;i++)
    for(j=1;j<=n;j++)
      ans=max(ans,(a[i]-a[j])*(i!=j));
  cout<<ans;
}

Compiler output:
a.cc:3:1: error: 'inr' does not name a type; did you mean 'int'?
    3 | inr n,a[111],i,j,ans;
      | ^~~
      | int
a.cc: In function 'int main()':
a.cc:5:8: error: 'n' was not declared in this scope
    5 |   cin>>n;
      |        ^
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=1;i<=n;i++)
      |       ^
a.cc:7:10: error: 'a' was not declared in this scope
    7 |     cin>>a[i];
      |          ^
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=1;i<=n;i++)
      |       ^
a.cc:9:9: error: 'j' was not declared in this scope
    9 |     for(j=1;j<=n;j++)
      |         ^
a.cc:10:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |       ans=max(ans,(a[i]-a[j])*(i!=j));
      |       ^~~
      |       abs
a.cc:10:20: error: 'a' was not declared in this scope
   10 |       ans=max(ans,(a[i]-a[j])*(i!=j));
      |                    ^
a.cc:11:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   cout<<ans;
      |         ^~~
      |         abs
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[N];
    }
    
    int m=0;
    int n=10**9;
    for (int i=1;i<N;i++){
        m = max(m,A[i]);
        n = min(n,A[i]);
    }
    cout << m-n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: invalid type argument of unary '*' (have 'int')
   12 |     int n=10**9;
      |              ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    int A[N];
    cin >> N;
    for (i=0;i<N;i++){
        cin >> A[N];
    }
    
    int m=0;
    int n=10**9;
    for (i=1;i<N;i++){
        m = max(m,A[i]);
        n = min(n,A[i]);
    }
    cout << m-n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'i' was not declared in this scope
    7 |     for (i=0;i<N;i++){
      |          ^
a.cc:12:14: error: invalid type argument of unary '*' (have 'int')
   12 |     int n=10**9;
      |              ^~
a.cc:13:10: error: 'i' was not declared in this scope
   13 |     for (i=1;i<N;i++){
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    int A[N];
    cin >> N;
    for (i=0;i<N;i++){
        cin >> A[N]
    }
    
    int m=0;
    int n=10**9;
    for (i=1;i<N;i++){
        m = max(m,A[i])
        n = min(n,A[i])
    }
    cout << m-n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'i' was not declared in this scope
    7 |     for (i=0;i<N;i++){
      |          ^
a.cc:8:20: error: expected ';' before '}' token
    8 |         cin >> A[N]
      |                    ^
      |                    ;
    9 |     }
      |     ~               
a.cc:12:14: error: invalid type argument of unary '*' (have 'int')
   12 |     int n=10**9;
      |              ^~
a.cc:13:10: error: 'i' was not declared in this scope
   13 |     for (i=1;i<N;i++){
      |          ^
Language: C++

#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

LL N, ans;

int main()
{
	in >> N;
	std::vector<LL>A(N);
	rep(i, N) in >> A[i];
	rep(i, N)
	{
		rep(j, N)
		{
			ans = std::max(ans, abs(A[i] - A[j]));
		}
	}
	out << ans << std::endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:39: error: no matching function for call to 'max(LL&, int)'
   18 |                         ans = std::max(ans, abs(A[i] - A[j]));
      |                               ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
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: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:18:39: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   18 |                         ans = std::max(ans, abs(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
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:18:39: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   18 |                         ans = std::max(ans, abs(A[i] - A[j]));
      |                               ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#incude <bits/stdc++.h>

using namespace std;


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


  
  
  
  
  
  


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include?
    1 | #incude <bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:15:3: error: 'cin' was not declared in this scope
   15 |   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 | #incude <bits/stdc++.h>
a.cc:21:10: error: 'min' was not declared in this scope; did you mean 'mini'?
   21 |     mini=min(mini,A[i]);
      |          ^~~
      |          mini
a.cc:24:10: error: 'max' was not declared in this scope; did you mean 'maxi'?
   24 |     maxi=max(maxi,A[i]);
      |          ^~~
      |          maxi
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout << maxi-mini << endl;
      |   ^~~~
a.cc:27:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:24: error: 'endl' was not declared in this scope
   27 |   cout << maxi-mini << endl;
      |                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incude <bits/stdc++.h>
Language: C++

#incude <bits/intc++.h>

using namespace std;


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


  
  
  
  
  
  

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include?
    1 | #incude <bits/intc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:15:3: error: 'cin' was not declared in this scope
   15 |   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 | #incude <bits/intc++.h>
a.cc:17:18: error: 'n' was not declared in this scope
   17 |   for (int i=0;i<n;i++){
      |                  ^
a.cc:21:10: error: 'min' was not declared in this scope; did you mean 'mini'?
   21 |     mini=min(mini,A[i]);
      |          ^~~
      |          mini
a.cc:24:10: error: 'max' was not declared in this scope; did you mean 'maxi'?
   24 |     maxi=max(maxi,A[i]);
      |          ^~~
      |          maxi
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout << maxi-mini << endl;
      |   ^~~~
a.cc:27:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:24: error: 'endl' was not declared in this scope
   27 |   cout << maxi-mini << endl;
      |                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incude <bits/intc++.h>
Language: C++

#include<stdio.h>
int main(void)
{
        int max,min,i,n,a[1000000000];
        scanf("%d",&n);
        scanf("%d",&a[0]);
        max=min=a[0];
        for(i=1,i<n,i++){
                scanf("%d",&a[i]);
                if(a[i]>max) max=a[i];
                else if(a[i]<min) min=a[i];
        }
        printf("%d\n",max-min);
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before ')' token
    8 |         for(i=1,i<n,i++){
      |                        ^
      |                        ;
a.cc:14:9: error: expected primary-expression before 'return'
   14 |         return 0;
      |         ^~~~~~
a.cc:13:32: error: expected ')' before 'return'
   13 |         printf("%d\n",max-min);
      |                                ^
      |                                )
   14 |         return 0;
      |         ~~~~~~                  
a.cc:8:12: note: to match this '('
    8 |         for(i=1,i<n,i++){
      |            ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
	int n;cin>>n;
	int a[n+1];
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i++)
	{
		cout<<a[n]-a[1]<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |         sort(a+1,a+n+1);
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <cstdlib>
#include <cmath>

using namespace std;

int main()
{
	int N, i;
	long long A[100] = { 0 }, max=2, min=LLONG_MAX;

	cin >> N;
	for (i = 0; i < N; i++)
		cin >> A[i];

	for (i = 0; i < N; i++) {
		if (max < A[i])
			max = A[i];
		if (min > A[i])
			min = A[i];
	}

	cout << max-min << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:46: error: 'LLONG_MAX' was not declared in this scope
   10 |         long long A[100] = { 0 }, max=2, min=LLONG_MAX;
      |                                              ^~~~~~~~~
a.cc:4:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <cmath>
  +++ |+#include <climits>
    4 |
Language: Java

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class tmp2
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int[] a=new int[n];
		for(int i=0;i<n;i++){
			a[i]=in.nextInt();
		}
		Arrays.sort(a);
		System.out.println(Math.abs(a[0]-a[n-1]));
	}
}

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

#include<bits/stdc++.h>
using namespace std;
const int nmax = 200;
int a[nmax],n;
int main(){
    scanf("%d",&n);
    for(int i = 1;i<=n;++i) scanf("%d",&a[i]);
    sort(a+1,a+1+n);
    printf("%d\n",abs(a[1]-a[n]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:33: error: expected ')' before ';' token
    9 |     printf("%d\n",abs(a[1]-a[n]);
      |           ~                     ^
      |                                 )
Language: C++

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


int main(){
    int N; //数列の長さ
    std::vector<int> a_vec;
    int a[101];//最大100個の要素を持つ数列
    std::cin >> N;
    for(int i = 0; i < N; i++){
        std::cin >> a[i];
    }
    for (int i = 0; i < N; ++i){
        a_vec.emplace_back(a[i]);
    }
    
    int min = *std::min_element(a_vec.begin(), a_vec.end());
    int max = *std::max_element(a_vec.begin(), a_vec.end());
    
    int abs = std::abs(min - max);
    
    std::cout << abs << std::endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'?
   18 |     int min = *std::min_element(a_vec.begin(), a_vec.end());
      |                     ^~~~~~~~~~~
      |                     tuple_element
a.cc:19:21: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'?
   19 |     int max = *std::max_element(a_vec.begin(), a_vec.end());
      |                     ^~~~~~~~~~~
      |                     tuple_element
Language: Java

import java.util.Scanner;

public class practice2 {
	public static void Main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt();
		int max=0;
		int min=2147483647;
		int a=0;
		for(int i=0;i<n;i++) {
			a=scan.nextInt();
			if(max<=a) {
				max=a;
			}
			if(min>=a){
				min=a;
			}
		}
		int result=max-min;

		System.out.println(result);
		scan.close();		

	}
}

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

import java.util.Scanner;

public class practice2 {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt();
		int max=0;
		int min=2147483647;
		int a=0;
		for(int i=0;i<n;i++) {
			a=scan.nextInt();
			if(max<=a) {
				max=a;
			}
			if(min>=a){
				min=a;
			}
		}
		int result=max-min;

		System.out.println(result);
		scan.close();		

	}
}

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

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt();
		int max=0;
		int min=100;
		int a=0;
		for(int i=0;i<n;i++) {
			a=scan.nextInt();
			if(max<a) {
				max=a;
			}
			if(min>a){
				min=a;
			}
		}
		int result=max-min;
		scan.close();
		System.out.println(result);
		

	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<iostream>
#include<cstdlib>
#include<set>
#include<vector>
using namespace std;
int main(){
  vector<int> v;
  int n,i,k;
  cin >>n;
  for (i=0;i<n;i++){
    cin>>k;
    v.push_back(k);
  }
  sort(v.begin(),v.end());
  cout << v[n-1]-v[0] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |   sort(v.begin(),v.end());
      |   ^~~~
      |   short
Language: C++

#include<iostream>
#include<cstdlib>
#include<set>
#include<vector>
using namespace std;
int main(){
  vector<int> v;
  int n,i,k;
  scanf("%d\n",&n);
  for (i=0;i<n;i++){
    scanf("%d ",&k);
    v.push_back(k);
  }
  sort(v.begin(),v.end());
  printf("%d\n",v[n-1]-v[0]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |   sort(v.begin(),v.end());
      |   ^~~~
      |   short
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int max = Integer.MIN_VALUE;
		int min = Integer.MAX_VALUE;
		for (int i=0; i<n; i++) {
			int val = scan.nextInt();
			if (val>max) {
				max=val;
			}
			if (val<min) {
				min=val;
			}
		}
		System.out.println(max-min);
		scan.close();
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		scan = new Scanner(System.in);
		int max = Integer.MIN_VALUE;
		int min = Integer.MAX_VALUE;
		for (int i=0; i<n; i++) {
			int val = scan.nextInt();
			if (val>max) {
				max=val;
			}
			if (val<min) {
				min=val;
			}
		}
		System.out.println(max-min);
		scan.close();
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		scan = new Scanner(System.in);
		           ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: Java

import java.util.*;

public class HelloWorld
{
  public static void main(String[] args)
  {
	Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
	int a[] = new int[n];
	int min = sc.nextInt(), max = min;
    for (int i=1; i<n; i++) {
      a[i] = sc.nextInt();
      if (a[i] < min) min = a[i];
      if (a[i] > max) max = a[i];
    }
    System.out.println(max - min);
  }
}


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

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

int main() {
    int N;
    long int A[110];
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort (A[0], A[N-1]);
    cout << A[N-1] - A[0] <<endl;
    return 0;
}


    


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

#include<stdio.h>
int main()
{
  long long int n, i, max=0, min=1000000000;
  scanf("%lld", &n);
  for(i=1; i<=n; i++)
  {
    scanf("%lld", &a);
    if(a>max) max=a;
    if(a<min) min=a;
  }
  printf("%lld", max-min);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: 'a' was not declared in this scope
    8 |     scanf("%lld", &a);
      |                    ^
Language: C++

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

using namespace std;

int main(){
  vector<int> vc;
  int n;
  int x;
  
  cin >> n;
  
  for(int i = 0; i < n; i++){
    cin >> x;
    vc.push_back(x);
  }
  
  sort(vc.begin(),vc.end);

  cout << vc.back() - vc.front() << "\n";
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: no matching function for call to 'sort(std::vector<int>::iterator, <unresolved overloaded function type>)'
   19 |   sort(vc.begin(),vc.end);
      |   ~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:63: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++


using namespace std;

int main(){
  int N;
  int a_min,a_max;

  cin>>N;

  for(int i=0;i<N;i++){
    int temp;
    cin >> temp;
    if(i==0){
      a_min=temp;
      a_max=temp;
    }

    if(temp < a_min) a_min = temp;
    else if(temp > a_max) a_max = temp;
  }
  
  scanf("%d",N);
  
  cout << a_max - a_min << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   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 | 
a.cc:22:3: error: 'scanf' was not declared in this scope
   22 |   scanf("%d",N);
      |   ^~~~~
a.cc:24:3: error: 'cout' was not declared in this scope
   24 |   cout << a_max - a_min << endl;
      |   ^~~~
a.cc:24:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:28: error: 'endl' was not declared in this scope
   24 |   cout << a_max - a_min << endl;
      |                            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 |
Language: C++

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


int main() {
    int a, b;
    int max = 0;
    int min = INT_MAX;
    scanf("%d", &a);
    int i;
    for(i = 0; i < a; i++){
        scanf("%d", &b);
        if(max < b) max = b;
        if(min > b) min = b;
    }
    
    cout << max - min << "\n";
    
    return 0;
}


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

#include<ctsdio>
#include<algorithm>
#include<cstdlib>
int main(){
  int n;scanf("%d", &n);
  int a[1000000];
  for(int i = 0; i < n; i++) scanf("%d", &n);
  std::sort(a, a+n);
  printf("%d\n", a[n-1]-a[0]);
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
    9 |   sort(A.bigin(), A.end());
      |          ^~~~~
      |          begin
Language: C++

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

int main(void) {
  int N, i = 0;
  cin >> N;
  vector<int> A(N);
  for(; i < N; i++) cin >> A[i];
  sort(A.bigin(), B.bigin());
  cout << A[N - 1] - A[0] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
    9 |   sort(A.bigin(), B.bigin());
      |          ^~~~~
      |          begin
a.cc:9:19: error: 'B' was not declared in this scope
    9 |   sort(A.bigin(), B.bigin());
      |                   ^
Language: C++

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

int main() {
	int n;
	cin >> n;
	vector<long long> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	long long x = a[n-1] - a[0];
	cout << x << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:16:27: error: expected '}' at end of input
   16 |         cout << x << endl;
      |                           ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

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

int main(int argc, char const *argv[])
{
	int N;
	cin >> N;
	vector<int> arr(N);
	for(int i = 0; i < N; i++)
		cin>> arr[i];

	sort(arr.begin(), arr.end());
	cout << (arr[arr.size() - 1] - arr[0]) << '\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |         sort(arr.begin(), arr.end());
      |         ^~~~
      |         short
Language: C++

//{{{
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop,~))(__VA_ARGS__)
#define loop(n) rep2(_loop_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define repN(a) repX a
#define repX(a0,a1,a2,x,...) x
const int MOD = 1e9+7;
//}}}

int main(){
	int N;
	cin >> N;
	rep(i,N)cin>>a[i];
	int ans=0;
	rep(i,N){
		rep(j,N){
			ans = max(ans, a[i]-a[j]);
			ans = max(ans, a[j]-a[i]);
		}
	}
	cout<<ans<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: 'a' was not declared in this scope
   17 |         rep(i,N)cin>>a[i];
      |                      ^
a.cc:21:40: error: 'a' was not declared in this scope
   21 |                         ans = max(ans, a[i]-a[j]);
      |                                        ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main(){
  ll N;
  cin >> N;
  vector<ll> as(N);
  for (ll i = 0; i < N; i++){
  	cin >> as.at(i);
  }
  ll m{numeric_limits<ll>::min()};
  for (ll i = 0; i < N; i++){
  	for (ll j = 0; j < N; j++){
      if (i == j) continue;
      m = max(abs(as.at(i)-as.at(j)));
    }
  }
  cout << m;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: no matching function for call to 'max(long long int)'
   17 |       m = max(abs(as.at(i)-as.at(j)));
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~
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: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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
a.cc:17:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   17 |       m = max(abs(as.at(i)-as.at(j)));
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int n, a[100];
  cin >> n;
  for(int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  cout << a[n - 1] - a[0] << endl;
  return 0;

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

#include <iostream>
#include <cmath>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  
  for(int i=0;i<n ;i++)cin >> a[i];
  
  int res = 0;
  
  for(int i=0 ; i<n-1 ; i++){
    for(int j=i+1 ; j<n ; j++){
      int div = abs(a[i]-a[j]);
      res = max(div,res)
    }
  }
  
  cout << res << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: expected ';' before '}' token
   16 |       res = max(div,res)
      |                         ^
      |                         ;
   17 |     }
      |     ~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int N;cin>>N;int a[N]={0};for(i=0;i<N;i++)cin>>a[i];
  sort(a,a+N);
  cout<<abs(a[0]-a[N-1])<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:33: error: 'i' was not declared in this scope
    5 |   int N;cin>>N;int a[N]={0};for(i=0;i<N;i++)cin>>a[i];
      |                                 ^
Language: C++

#include<iostream>
#include<algorithm>
#include<math>
using namespace std;
int main(){
  int N;cin>>N;int a[N]={0};for(i=0;i<N;i++)cin>>a[i];
  sort(a,a+N);
  cout<<abs(a[0]-a[N-1])<<endl;
}

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

#include<stdio.h.>
int main()
{
	int N, A[100], i,j;
	int kari,zettai;
	scanf("%d", &N);
	for (i = 0; i < N; i++)
	{
		scanf("%d", &A[i]);
	}
	for (j = 0; j < N; j++) {
		for (i = 0; i < N; i++)
		{
			if (A[i] < A[i + 1])
			{
				kari = A[i];
				A[i] = A[i + 1];
				A[i + 1] = kari;
			}
		}
	}
	zettai = A[0] - A[N - 1];
	if (zettai < 0)zettai = zettai * -1;
	printf("%d\n", zettai);
	return 0;
}

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

#include <iostream>
#include <vector>

using namespace std;

int main() {
  int N;
  vector<int> A(N);
  for(int i = 0; i < N; i++) {
  	cin >> A[i];
  }
  sort(A.begin(), A.end());
  cout << A.back() - A[0] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(A.begin(), A.end());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main(){
 int n; cin >> n;
  int *a = new int[n];
  for(int i = 0; i < n; i++)cin >> a[i];
  int maxi = -1;
  for(int i = 0; i < n - 1; i++){
   for(int j = i + 1; j < n; j++){
    if(abs(a[i]-a[j]) > maxi)max=abs(a[i]-a[j]);
   }
  }
  cout << maxi << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:47: error: overloaded function with no contextual type information
   13 |     if(abs(a[i]-a[j]) > maxi)max=abs(a[i]-a[j]);
      |                                               ^
Language: C++

#include<iostream>
using namespace std;
int a ;
int b,c ;
int s ;

int main(){
   cout << a+b+c <<endl ;
   cout << s << endl ;
   return 0 ;
}

#include<iostream>
 
using namespace std;
 
int N;
cin >> N ;
int A[110];
 
int main(){
   int c = 1000000001;//c min b max
   cin >> c;
   int b = 0 ;
   cin >> b ;
   for(int i = 0 ; i < N; ++i ){
      if (A[i] > b){
         b = A[i] ;
      }
      if (A[i] < c){
         c = A[i] ;
      }
   }
   int ans = b - c;
   cin ans;
   cout << ans << endl ;
}
   
   

Compiler output:
a.cc:18:1: error: 'cin' does not name a type
   18 | cin >> N ;
      | ^~~
a.cc:21:5: error: redefinition of 'int main()'
   21 | int main(){
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main(){
      |     ^~~~
a.cc: In function 'int main()':
a.cc:35:7: error: expected ';' before 'ans'
   35 |    cin ans;
      |       ^~~~
      |       ;
Language: C++

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

int a[101];
void main(){
    int n;
    cin >> n;
    for(int i = 0;i < n; ++i)cin >> a[i];
    sort(a, a+n);
    cout << abs(a[0] - a[n-1]) << endl;
    return 0;
}

Compiler output:
a.cc:7:1: error: '::main' must return 'int'
    7 | void main(){
      | ^~~~
Language: C++

include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  vector<int> vec(a);
  for (int i = 0; i < a; i++) cin >> vec.at(i);
  sort(vec.begin(), vec.end());
  cout << vec.at(a - 1) - vec.at(0) << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> a;
      |   ^~~
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> vec(a);
      |   ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> vec(a);
      |          ^~~
a.cc:7:38: error: 'vec' was not declared in this scope
    7 |   for (int i = 0; i < a; i++) cin >> vec.at(i);
      |                                      ^~~
a.cc:8:8: error: 'vec' was not declared in this scope
    8 |   sort(vec.begin(), vec.end());
      |        ^~~
a.cc:8:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |   sort(vec.begin(), vec.end());
      |   ^~~~
      |   short
a.cc:9:3: error: 'cout' was not declared in this scope
    9 |   cout << vec.at(a - 1) - vec.at(0) << endl;
      |   ^~~~
a.cc:9:40: error: 'endl' was not declared in this scope
    9 |   cout << vec.at(a - 1) - vec.at(0) << endl;
      |                                        ^~~~
Language: C

#include <stdio.h>
int main(void){
    int n,i,max,min,a[];
    scanf("%d\n",&n);
    for(i=0;i<n;i++){
        scanf("%d ",&a[i]);
    }
    max=a[0];
    min=a[0];
    for(i=0;i<n;i++){
        if(max<a[i]){
            max=a[i];
        }
    }
    for(i=0;i<n;i++){
        if(a[i]<min){
            min=a[i];
        }
    }
    printf("%d",max-min);
}

Compiler output:
main.c: In function 'main':
main.c:3:21: error: array size missing in 'a'
    3 |     int n,i,max,min,a[];
      |                     ^
Language: C

#include <stdio.h>
#define MIN 1000000000
#define MAX 0

int main(void){
  int min=MIN,max=MAX,a,n,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a);
    if( a < min ) min=a;
    if( max < a ) max=a;
  }
  
  pritnf("%d\n",max-min);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:3: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   14 |   pritnf("%d\n",max-min);
      |   ^~~~~~
      |   printf
Language: C++

#include <iostream>
#include <climits>
#include <algorithms>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int num_min = INT_MAX;
    int num_max = INT_MIN;
    int x;
    for (int i = 0; i < n; ++i)
    {
        cin >> x;
        num_min = min(num_min, x);
        num_max = max(num_max, x);
    }
    cout << num_max - num_min << endl;
    return 0;
}

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

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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end()

#define CHMIN(a, b) a=min((a), (b))
#define CHMAX(a, b) a=max((a), (b))

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N;
  cin >> N;
  int a;
  int max = -99999999;
  int min = 99999999;
  rep(i, N) {
    cin >> a;
    max = max(max, a);
    min = min(min, a);
  }
  cout << max - min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: 'max' cannot be used as a function
   21 |     max = max(max, a);
      |           ~~~^~~~~~~~
a.cc:22:14: error: 'min' cannot be used as a function
   22 |     min = min(min, a);
      |           ~~~^~~~~~~~
Language: C++

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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end()

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N;
  cin >> N;
  int a;
  int max = -99999999;
  int min = 99999999;
  rep(i, N) {
    cin >> a;
    max = max(max, a);
    min = min(min, a);
  }
  cout << max - min << endl;
}


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

int a;main(){scanf("%d",&a);printf("%d",a+a%2*a);}

Compiler output:
a.cc:1:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | int a;main(){scanf("%d",&a);printf("%d",a+a%2*a);}
      |       ^~~~
a.cc: In function 'int main()':
a.cc:1:14: error: 'scanf' was not declared in this scope
    1 | int a;main(){scanf("%d",&a);printf("%d",a+a%2*a);}
      |              ^~~~~
a.cc:1:29: error: 'printf' was not declared in this scope
    1 | int a;main(){scanf("%d",&a);printf("%d",a+a%2*a);}
      |                             ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int a;main(){scanf("%d",&a);printf("%d",a+a%2*a);}
Language: C++

#include<iostream>

using namespace std;
int main()
{
    int n;
    int max=0,min=0;
    cin>>n;
    while(n--)
{
     int m;
     cin>>m;
     if(m>max)
max=m;
if(m<min)
min=m;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:6: error: return-statement with no value, in function returning 'int' [-fpermissive]
   20 |      return ;
      |      ^~~~~~
Language: C++

#include<stdio.h>
#define MAX 100

int tmain(void) {

	int N, i, tmp;
	int	max = 0;
	int min = 1;
	int A[MAX];

	scanf_s("%d", &N);

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

		scanf_s("%d", &A[i]);
		tmp = A[i];

		if (tmp > max) {
			max = tmp;
		}
		else if (tmp < min) {
			min = tmp;
		}
	}

	printf("%d", max - min);
}

Compiler output:
a.cc: In function 'int tmain()':
a.cc:11:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   11 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
a.cc:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
   27 | }
      | ^
Language: C++

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

int main(){
  int N;
  scanf("%d",&N);
  int a[N];
  for (i=0;i<N;i++){
    scanf("%d",a[i]);
  }
  sort(a,a+N);
  printf("%d",a[N]-a[0]);
  return 0;
}

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

#include<stdio.h>
#define MAX 100

int main(void) {

	int N, i, tmp;
	int	max = 0;
	int min = 1;
	int A[MAX];

	scanf_s("%d", &N);

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

		scanf("%d", &A[i]);
		tmp = A[i];

		if (tmp > max) {
			max = tmp;
		}
		else if (tmp < min) {
			min = tmp;
		}
	}

	printf("%d", max - min);
}

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

#include<stdio.h>
#define MAX 100

int main(void) {

	int N, i, tmp;
	int	max = 0;
	int min = 1;
	int A[MAX];

	scanf_s("%d", &N);

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

		scanf_s("%d", &A[i]);
		tmp = A[i];

		if (tmp > max) {
			max = tmp;
		}
		else if (tmp < min) {
			min = tmp;
		}
	}

	printf("%d", max - min);
}

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