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

#include <iostream>

using namespace std;

int main(){
  int A1 , A2 , A3 ;
  cin >> A1 >> A2 >> A3 ;
  int ans = max(A1 , A2 , A3) - min(A1 , A2 , A3);
  cout << ans <<endl;
}


Compiler output:
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:8:16:   required from here
    8 |   int ans = max(A1 , A2 , A3) - min(A1 , A2 , A3);
      |             ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:8:36:   required from here
    8 |   int ans = max(A1 , A2 , A3) - min(A1 , A2 , A3);
      |                                 ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

int main(){
  int A1 , A2 , A3 ;
  cin >> A1 >> A2 >> A3 ;
  int ans = max({A1 , A2 , A3}) - min({A1 , A2 , A3});
  cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
    8 |   int ans = max({A1 , A2 , A3}) - min({A1 , A2 , A3});
      |             ~~~^~~~~~~~~~~~~~~~
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:   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
a.cc:8:38: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
    8 |   int ans = max({A1 , A2 , A3}) - min({A1 , A2 , A3});
      |                                   ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

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


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


#include <iostream>
#include <cmath>
using namespace std;
const int N = 3;

int main() {
    
    
    int a[N], n;
  
        n = 3;
        for(int i = 0 ; i <n ; ++ i)
            
            cin>>a[i];
            sort(a, a + 3);
        int ans = abs(a[1] - a[0]) + abs(a[2] - a[1]);
        do {
            ans = min(ans, abs(a[1] - a[0]) + abs(a[2] - a[1]));
        } while(next_permutation(a , a +  3));
    
    
    cout << ans << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   16 |             sort(a, a + 3);
      |             ^~~~
      |             sqrt
a.cc:20:17: error: 'next_permutation' was not declared in this scope
   20 |         } while(next_permutation(a , a +  3));
      |                 ^~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
const int N = 3;

int main(int argc, const char * argv[]) {
    
    
    int a[N], n;
  
        n = 3;
        for(int i = 0 ; i <n ; ++ i)
            
            cin>>a[i];
            sort(a, a + 3);
        int ans = abs(a[1] - a[0]) + abs(a[2] - a[1]);
        do {
            ans = min(ans, abs(a[1] - a[0]) + abs(a[2] - a[1]));
        } while(next_permutation(a , a +  3));
    
    
    cout << ans << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:15:13: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   15 |             sort(a, a + 3);
      |             ^~~~
      |             sqrt
a.cc:19:17: error: 'next_permutation' was not declared in this scope
   19 |         } while(next_permutation(a , a +  3));
      |                 ^~~~~~~~~~~~~~~~
Language: C++

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

int main(){
  vector<int> v(3);
  for (int i; i<3; i++){
    cin >> v.at(i) ;
  }
  v.sort(v.begin(),v.end());
  cout << v.at(2)-v.at(0) <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'class std::vector<int>' has no member named 'sort'
   10 |   v.sort(v.begin(),v.end());
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  vector<int> v(3);
  for (int i, i<3, i++){
    cin >> v.at(i) ;
  }
  v.sort(v.begin(),v.end());
  cout << v.at(2)-v.at(0) <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> v(3);
      |   ^~~~~~
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:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> v(3);
      |          ^~~
a.cc:6:16: error: expected ';' before '<' token
    6 |   for (int i, i<3, i++){
      |                ^
      |                ;
a.cc:6:16: error: expected primary-expression before '<' token
a.cc:6:23: error: expected ';' before ')' token
    6 |   for (int i, i<3, i++){
      |                       ^
      |                       ;
a.cc:7:12: error: 'v' was not declared in this scope
    7 |     cin >> v.at(i) ;
      |            ^
a.cc:9:3: error: 'v' was not declared in this scope
    9 |   v.sort(v.begin(),v.end());
      |   ^
Language: C++

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

int main() {
    vector<int> tasks;
    
    for (int i = 0; i < 3; i ++) {
        int newTask; cin >> newTask;
        tasks.push_back(newTask);
    }
    sort(tasks.begin(), tasks.end());
    int max = tasks.back();
    int min = tasks.front();

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

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

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

int main() {
    vector<int> tasks;
    
    for (int i = 0; i < 3; i ++) {
        int newTask; cin >> newTask;
        tasks.push_back(newTask);
    }
    
    int max = *max_element(tasks.begin(), tasks.end());
    int min = *min_element(tasks.begin(), tasks.end());
    
    cout << max - min << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'max_element' was not declared in this scope
   13 |     int max = *max_element(tasks.begin(), tasks.end());
      |                ^~~~~~~~~~~
a.cc:14:16: error: 'min_element' was not declared in this scope
   14 |     int min = *min_element(tasks.begin(), tasks.end());
      |                ^~~~~~~~~~~
Language: Java

import java.util.*;

public class Mofu{
  public static void main(String[] args){
  	Scanner scan = new Scanner(System.in);
    
    int mofu[] = new int[3];
    
    for(int i = 0; i < 3 ; i++){
   	 mofu[i] = scan.nextInt();
    }
    
    int maxmofu = mofu[0];
    int minmofu = mofu[0];
    
    //大小比較
    for(int i = 1; i < 3 ; i++){
      
      if(maxmofu < mofu[i]){
        maxmofu = mofu[i];
      }
      if(minmofu > mofu[i]){
        minmofu = mofu[i];
      }
    }
    System.out.println("合計コストは" + (maxmofu - minmofu) + "です。");
  }
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{int n[3];
cin>>n[0]>>n[1]>>n[2];
sort(n,n+3);
cout<<n[2]-n[0];
return(0);
}.

Compiler output:
a.cc:9:2: error: expected unqualified-id before '.' token
    9 | }.
      |  ^
Language: C++

#include<bits/stdc++.h>
int main()
{int n[3];
cin>>n[0]>>n[1]>>n[2];
sort(n,n+3);
cout<<n[2]-n[0];
return(0);
}.

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 | cin>>n[0]>>n[1]>>n[2];
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:1: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    5 | sort(n,n+3);
      | ^~~~
      | std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/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:6:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 | cout<<n[2]-n[0];
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc: At global scope:
a.cc:8:2: error: expected unqualified-id before '.' token
    8 | }.
      |  ^
Language: C++

#include<stdio.h>

int main(void)
{
 int a[3];
 int i,j,s,t,m;

 for(i=0;i<3;i++){
  scanf("%d", &a[i]);
 }

 for(i=1;i<3;i++){
  if(a[i-1]>a[i]){
   t=a[i];
   a[i]=a[i-1];
   a[i-1]=t;
  }
 }

 s=0;
 for(i=0;i<2;i++){
  m=a[i+1]-a[i];
 if(m<0)s+=m;
 }


 printf("%d\n", s);

 return 0;
}
 m=m*(-1);
                                                              1,2          先頭


Compiler output:
a.cc:31:2: error: 'm' does not name a type
   31 |  m=m*(-1);
      |  ^
a.cc:32:63: error: expected unqualified-id before numeric constant
   32 |                                                               1,2          先頭
      |                                                               ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int min = INT_MAX, max = INT_MIN, x;
    for (int i = 0; i < 3; ++i)
    {
    	cin >> x;
    	if (x > max)
    		max = x;
    	if (x < min)
    		min = x;
    }
    cout << max-min << "\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'INT_MAX' was not declared in this scope
    7 |     int min = INT_MAX, max = INT_MIN, x;
      |               ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | 
a.cc:10:16: error: 'x' was not declared in this scope
   10 |         cin >> x;
      |                ^
a.cc:16:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   16 |     cout << max-min << "\n";
      |             ~~~^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main (void) {
	int a[3];
	int cnt;
	max(1,2)
	for (cnt = 0;cnt < 3; cnt++){
		cin >> a[cnt];
		}
	
	cout << max(max(a[0], a[1]), a[2]) - min(min(a[0], a[1]), a[2]) << "\n";
	
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected ';' before 'for'
    8 |         max(1,2)
      |                 ^
      |                 ;
    9 |         for (cnt = 0;cnt < 3; cnt++){
      |         ~~~      
a.cc:8:12: warning: ignoring return value of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]', declared with attribute 'nodiscard' [-Wunused-result]
    8 |         max(1,2)
      |         ~~~^~~~~
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: declared here
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:9:36: error: expected ';' before ')' token
    9 |         for (cnt = 0;cnt < 3; cnt++){
      |                                    ^
      |                                    ;
Language: C++

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

int main () {
    int A[3];
    for (int a=0; a<3; a++)
        scanf("%d", &A[a]);

    sort(A, A+3);

    int ans = A[2] - A[0]

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: expected ',' or ';' before 'cout'
   13 |     cout << ans << endl;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll long long int
#define f(i,a,b) for(ll i=a;i<b;i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define en '\n'

int main()
{
	IOS;
	int t=1;
//	cin>>t;
	while(t--)
	{
int a[3];
f(i,0,3)
cin>>a[I];
sort(a,a+3);
int ans=0;
ans+=abs(a[1]-a[0]);
ans+=abs(a[2]-a[1]);
cout<<ans;
	}
}

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

#include<iostream>
#include<vector>

using namespace std;

#define REP(i, n) for(int i=0; i<n; i++)

int main(){
    int num[3];
    cin >> num[0] >> num[1] >> num[2];
    
    int max = *max_element(num, num+3);
    int min = *min_element(num, num+3);

    cout << max-min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'max_element' was not declared in this scope
   12 |     int max = *max_element(num, num+3);
      |                ^~~~~~~~~~~
a.cc:13:16: error: 'min_element' was not declared in this scope
   13 |     int min = *min_element(num, num+3);
      |                ^~~~~~~~~~~
Language: Java

public class Main{
public static void main(String[] args){
        Scanner scanner = new Scanner("1 6 3");//System.in);
        int[] As = new int[3];
        As[0] = scanner.nextInt();
        As[1] = scanner.nextInt();
        As[2] = scanner.nextInt();

        int bestCost = 99999;
        for(int i = 0; i < 3;i++){

            for(int j = 0; j < 3;j++){
                if(j == i) continue;
                int sum = 3 - i - j;
                int a = Math.abs(As[j] - As[i]);
                a+=  Math.abs(As[sum] - As[j]);
                if(a < bestCost){
                    bestCost = a; 
                }
            }

        }
        System.out.println(bestCost);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner("1 6 3");//System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner("1 6 3");//System.in);
                              ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

int amin() {
    int A[3];

    scanf("%d%d%d", &A[0], &A[1], &A[2]);
    sort(A, A + 3);
    printf("%d\n", A[1] + A[2] - 2*A[0]);
    return 0;
}


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: Java

import java.util.*;
class Main{
       public static void main(String s[]){
            Scanner sc = new Scanner(System.in);
int arr[] =new int[3];            
int arr[0] = sc.nextInt();
int arr[1] = sc.nextInt();
int arr[2] = sc.nextInt();
Arrays.sort(arr);
System.out.println(arr[0]+arr[1]);
       }
}

Compiler output:
Main.java:6: error: ']' expected
int arr[0] = sc.nextInt();
        ^
Main.java:7: error: ']' expected
int arr[1] = sc.nextInt();
        ^
Main.java:8: error: ']' expected
int arr[2] = sc.nextInt();
        ^
3 errors
Language: Java

import java.util.Arrays;
import java.util.Scanner;

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

        Scanner input = new Scanner(System.in);

        int [] a = new int[3];

        for (int i = 0; i < 3; i++) {
            a[i] = input.nextInt();
        }

        Arrays.sort(a);

        System.out.println(Math.abs(a[0] - a[1]) + Math.abs(a[1] - a[2]));
    }
}


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

#include <iostream>
#include<fstream>
#include<queue>
#define MAXN 1000005
#define ll long long
using namespace std;
ll n, m, root[105 * 105], k;
const int N = 105;
int link[N];
bool vis[N];
vector<int>v[N];
ll ans;
string Find, a, b;
int NEXT[100005];

int main() {
	int a[3],sum;
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);
	sum = a[1] - a[0] + a[2] - a[1];
	cout << sum << endl;
	return 0;
}

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

package atcorder;

public class HelloWorld{
	  public static void main(String args[]){
		  int[] arg = new int[3];
	     int y;
	     for(int x=0 ; x < 3 ; x++){
		arg[x] = Integer.parseInt(args[x]);
	     }
	     if(arg[0] < arg[1]){
		y = arg[0];
		arg[0] = arg[1];
		arg[1] = y;
		System.out.println("テスト1");
	     }
	     if(arg[1] < arg[2]){
		y = arg[1];
		arg[1] = arg[2];
		arg[2] = y;
	     }
	     if(arg[0] < arg[1]){
		y = arg[0];
		arg[0] = arg[1];
		arg[1] = y;
	     }
	     for(int x=0; x<3;x++){
		System.out.println(arg[x]);
	     }
	     System.out.println((arg[0] - arg[1]) + (arg[1] - arg[2]));
	   }
	}

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 <stdio.h> 
 
 
int max （int x ，int y ，int z ）{
  int max = x ;
  if （y > max ）max = y ;
  if （z > max ）max = z ;
  
  返回最大值;
}
 
int min （int r ，int s ，int t ）{
  int min = r ;
  if （s < min ）min = s ;
  if （t < min ）min = t ;
  
  回归分钟;
}
 
int main （）{
  int a [ 3 ];
  scanf （“％d％d％d” ，＆a [ 0 ]，＆a [ 1 ]，＆a [ 2 ]）;
  
  int ans = （max （a [ 0 ]，a [ 1 ]，a [ 2 ]）- min （a [ 0 ]，a [ 1 ]，a [ 2 ]））;  
  printf （“％d \ n” ，ans ）; 
  
  返回0 ; 
}

Compiler output:
main.c:4:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '\U0000ff08int'
    4 | int max （int x ，int y ，int z ）{
      |         ^~~~~
main.c:4:9: error: unknown type name '\U0000ff08int'
main.c:12:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '\U0000ff08int'
   12 | int min （int r ，int s ，int t ）{
      |         ^~~~~
main.c:12:9: error: unknown type name '\U0000ff08int'
main.c:20:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '\U0000ff08\U0000ff09'
   20 | int main （）{
      |          ^~~~
main.c:22:11: error: stray '\342' in program
   22 |   scanf <U+FF08><U+201C><U+FF05>d<U+FF05>d<U+FF05>d<U+201D> <U+FF0C><U+FF06>a [ 0 ]<U+FF0C><U+FF06>a [ 1 ]<U+FF0C><U+FF06>a [ 2 ]<U+FF09>;
      |                 ^~~~~~~~
main.c:22:21: error: stray '\342' in program
   22 |   scanf <U+FF08><U+201C><U+FF05>d<U+FF05>d<U+FF05>d<U+201D> <U+FF0C><U+FF06>a [ 0 ]<U+FF0C><U+FF06>a [ 1 ]<U+FF0C><U+FF06>a [ 2 ]<U+FF09>;
      |                                                    ^~~~~~~~
main.c:25:12: error: stray '\342' in program
   25 |   printf <U+FF08><U+201C><U+FF05>d \ n<U+201D> <U+FF0C>ans <U+FF09>;
      |                  ^~~~~~~~
main.c:25:17: error: stray '\' in program
   25 |   printf （“％d \ n” ，ans ）;
      |                 ^
main.c:25:20: error: stray '\342' in program
   25 |   printf <U+FF08><U+201C><U+FF05>d \ n<U+201D> <U+FF0C>ans <U+FF09>;
      |                                       ^~~~~~~~
Language: C++

#include<iostream>
#include<vector>
 
using namespace std;
int main(){
  int N;
  cin>>N
  int n;
  vector<int> v;
  while(cin>>n){
  v.push_back(n)
    //処理
  }
  long long int x=1;
  for(int i=0;i<N;i++){
   x=lcm(x,v[i]); 
  }
  x--;
  int f=0;
   for(int i=0;i<N;i++){
    f+=x%v[i];
  }
  cout << f <<endl;
  return 0;
}
 
 
long long int lcm( long long int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected ';' before 'int'
    7 |   cin>>N
      |         ^
      |         ;
    8 |   int n;
      |   ~~~    
a.cc:10:14: error: 'n' was not declared in this scope
   10 |   while(cin>>n){
      |              ^
a.cc:16:6: error: 'lcm' was not declared in this scope
   16 |    x=lcm(x,v[i]);
      |      ^~~
a.cc: In function 'long long int lcm(long long int, int)':
a.cc:34:22: error: 'gcd' was not declared in this scope
   34 |         return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
      |                      ^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
 
int main()
{  
  int sum=0;
  int n;
  std::vector<int> v;
  while(cin>>n){
    v.push_back(n);
    //処理
  }
  // 並べ替える
  std::sort(v.begin(), v.end());
  sum+=v[1]-v[0];
  sum+=v[2]-v[1];
  std::cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   while(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
      |                  ^~~
Language: C++

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

int main()
{
  int a, b, c,sum=0;
  std::vector<int> v;
  std::cin >> a b c;
  v.push_back(a);
  v.push_back(b);
  v.push_back(c);
  // 並べ替える
  std::sort(v.begin(), v.end());
  sum+=v[1]-v[0];
  sum+=v[2]-v[1];
  std::cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected ';' before 'b'
    9 |   std::cin >> a b c;
      |                ^~
      |                ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
int main(){
  int a, b, c;
  cin >> a >> b >> c;
  cout<< max(a, b, c) - min(a, b, c) << endl;
  return 0;
}

Compiler output:
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:9:13:   required from here
    9 |   cout<< max(a, b, c) - min(a, b, c) << endl;
      |          ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:9:28:   required from here
    9 |   cout<< max(a, b, c) - min(a, b, c) << endl;
      |                         ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
int main(){
  cin >> a >> b >> c;
  cout<< max(a, b, c) - min(a, b, c) << endl;
  return 0;
}

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

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

int main(void){
  vector<int> stacks = vector<int>(3);
  for(int i = 0; i < 3; i++) cin >> stacks[i];
  
  vector<int> diffs = vector<int>(3);
  int max = abs(stacks[0] - stacks[1]);
  int sum = 0;
  for(int i = 0; i < 3; i++){
    int next = i + 1;
    if(next >= 3) next = 0;
    diffs[i] = abs(stacks[i] - stacks[next]);
    sum += diffs[i];
    if(max < diffs[i]) max = diffs;
  }
  cout << sum - max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: cannot convert 'std::vector<int>' to 'int' in assignment
   18 |     if(max < diffs[i]) max = diffs;
      |                              ^~~~~
      |                              |
      |                              std::vector<int>
Language: Java

import java.util.*;
import static java.lang.Math.*;


public class Main {
  public static void main(String[] args) {
    int[] myArgs = new int[3];
    Scanner sc = new Scanner(System.in);
    myArgs[0] = sc.nextInt();
    myArgs[1] = sc.nextInt();
    myArgs[2] = sc.nextInt();

    Main_103 logic = new Main_103();
    String output = logic.exec(myArgs);
    System.out.print(output);

  }

  private String exec(int[] myArgs) {
    long minCost = Long.MAX_VALUE;
    for (int i = 0;i < 3;i++) {
      for (int j = 0;j < 3;j++) {
        if (i != j) {
          long cost0 = abs(myArgs[i] - myArgs[j]);
          for (int k = 0;k < 3;k++) {
            if (i != k && j != k) {
              long cost1 = cost0 + abs(myArgs[j] - myArgs[k]);
              if (minCost > cost1) {
                minCost = cost1;
              }
              break;
            }
          }
        }
      }
    }
    return String.valueOf(minCost);
  }

Compiler output:
Main.java:38: error: reached end of file while parsing
  }
   ^
1 error
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
		int[] data = new int[3];
		for (int i = 0; i < data.length; i++) {
		    data[i] = sc.nextInt();
		}
		Arrays.sort(data);
		
		return (data[1] - data[0]) > (data[2] - data[1]) ?
		    (data[2] - data[1]) : (data[1] - data[0]);
	}
}

Compiler output:
Main.java:12: error: incompatible types: unexpected return value
		return (data[1] - data[0]) > (data[2] - data[1]) ?
		                                                 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main ()
{
  int a1,a2,a3;
  cin >> a1 >> a2 >> a3;
  int g1,g2,g3,s1,s2,s3;
  g1 = a1 -a2;
  g2 = a2 -a3;
  g3 = a3 -a1;
  if (g1 < 0) 
  {
    g1 = g1*(-1);
    s1 = a3 + g1;
  }
  if (g2<0)
  {
    g2=g2*(-1);
    s2 = a1 + g2;
  }
  if (g3<0)
  {
    g3 = g3*(-1);
    s3 = a2 + g3;
  }
  if (s1<s2 && s1<s3)
  {
    cout << s1 << endl;
  }
  if (s2<s1 $$ s2<s3)
  {
    cout << s2 << endl;
  }
  if (s3<s1 && s3<s2)
  {
    cout << s3 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:12: error: expected ')' before '$$'
   30 |   if (s2<s1 $$ s2<s3)
      |      ~     ^~~
      |            )
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main ()
{
  int a1,a2,a3;
  cin >> a1 >> a2 >> a3;
  int g1,g2,s1,s2,s3;
  g1 = a1 -a2;
  g2 = a2 -a3;
  g3 = a3 -a1;
  if (g1 < 0) 
  {
    g1 = g1*(-1);
    s1 = a3 + g1;
  }
  if (g2<0)
  {
    g2=g2*(-1);
    s2 = a1 + g2;
  }
  if (g3<0)
  {
    g3 = g3*(-1);
    s3 = a2 + g3;
  }
  if (s1<s2 && s1<s3)
  {
    cout << s1 << endl;
  }
  if (s2<s1 $$ s2<s3)
  {
    cout << s2 << endl;
  }
  if (s3<s1 && s3<s2)
  {
    cout << s3 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'g3' was not declared in this scope; did you mean 's3'?
   10 |   g3 = a3 -a1;
      |   ^~
      |   s3
a.cc:30:12: error: expected ')' before '$$'
   30 |   if (s2<s1 $$ s2<s3)
      |      ~     ^~~
      |            )
Language: C++

#include "stdafx.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
	int a1, a2, a3;
	cin >> a1 >> a2 >> a3;

	cout << max(a1, max(a2, a3)) - min(a1, min(a2, a3)) << endl;
}

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

#include<stdio.h>#include<math.h>int big(int a,int b){return a>b?a:b;}int main(void){int i,j,k=0;int a[3],b[3];int max=0,take=0;int N;for(i=0;i<N;i++)scanf("%d",&a[i]);for(i=0;i<N;i++){for(j=N-1;j>i;j--,k++){b[k]=fabs(a[i]-a[j]);max=big(max,b[k]);take+=b[k];}}printf("%d\n",take-max);}



Compiler output:
main.c:1:18: warning: extra tokens at end of #include directive
    1 | #include<stdio.h>#include<math.h>int big(int a,int b){return a>b?a:b;}int main(void){int i,j,k=0;int a[3],b[3];int max=0,take=0;int N;for(i=0;i<N;i++)scanf("%d",&a[i]);for(i=0;i<N;i++){for(j=N-1;j>i;j--,k++){b[k]=fabs(a[i]-a[j]);max=big(max,b[k]);take+=b[k];}}printf("%d\n",take-max);}
      |                  ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

 #include <stdio.h>
#include <stdlib.h>
int main(void){
    int i;
    int j;
    int flg = 0;
    char a[101];
    char b[101];  
    scanf("%s",a);
    char aa[101] = a;
    scanf("%s",b);
for(i = 0;a[i] != '￥0';i++)
int len = i-1;
    for(i=0;i<len;i++){
if(a(i) = b(i)){
for(j = 0;j<i;j++){
aa(len - i + j) = a(j);
}
for(j = i;j<len;j++){
aa(j-i) = a(j);
}
if(aa = b){
    flg = 1;
    break;
}
}
}
if(flg == 0){
printf("No");
      }else{
printf("Yes");
      }

return 0;
}

Compiler output:
a.cc:12:19: warning: multi-character character constant [-Wmultichar]
   12 | for(i = 0;a[i] != '￥0';i++)
      |                   ^~~~~
a.cc: In function 'int main()':
a.cc:10:20: error: array must be initialized with a brace-enclosed initializer
   10 |     char aa[101] = a;
      |                    ^
a.cc:14:15: error: 'len' was not declared in this scope; did you mean 'mblen'?
   14 |     for(i=0;i<len;i++){
      |               ^~~
      |               mblen
a.cc:15:5: error: 'a' cannot be used as a function
   15 | if(a(i) = b(i)){
      |    ~^~~
a.cc:15:12: error: 'b' cannot be used as a function
   15 | if(a(i) = b(i)){
      |           ~^~~
a.cc:17:15: error: 'aa' cannot be used as a function
   17 | aa(len - i + j) = a(j);
      |               ^
a.cc:17:20: error: 'a' cannot be used as a function
   17 | aa(len - i + j) = a(j);
      |                   ~^~~
a.cc:20:3: error: 'aa' cannot be used as a function
   20 | aa(j-i) = a(j);
      | ~~^~~~~
a.cc:20:12: error: 'a' cannot be used as a function
   20 | aa(j-i) = a(j);
      |           ~^~~
a.cc:22:7: error: invalid array assignment
   22 | if(aa = b){
      |    ~~~^~~
Language: C++

#include<stdio.h>

void main(){
	int task[128];
	
	for(int i = 0; i < 3; i++){
		scanf("%d", &task[i]);
	}
	
	int max;
	int min;
	
	max = task[0];
	if(task[1] > max) max = task[1];
	if(task[2] > max) max = task[2];
	
	min = task[0];
	if(task[1] < min) min = task[1];
	if(task[2] < min) min = task[2];
	
	int cost = max - min;
	printf("%d\n", cost);
		
}


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

//103 A

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

void main(){
	int task[128];
	
	for(int i = 0; i < 3; i++){
		scanf("%d", &task[i]);
	}
	
	int max;
	int min;
	
	max = task[0];
	if(task[1] > max) max = task[1];
	if(task[2] > max) max = task[2];
	
	min = task[0];
	if(task[1] < min) min = task[1];
	if(task[2] < min) min = task[2];
	
	int cost = max - min;
	printf("%d\n", cost);
		
}
	
	

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

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

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

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

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

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

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

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

using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string[] sInp = Console.ReadLine().Trim().Split(' ');
            List<int> lstTsk = new List<int>();
            for (int i = 0; i < sInp.Length; i++)
            { lstTsk.Add(int.Parse(sInp[i])); }

            // 解析
            int iOut = 0;
            lstTsk.Sort();
            for (int i = 1; i < lstTsk.Count; i++)
            { iOut += lstTsk[i] - lstTsk[i - 1]; }

            //出力
            Console.WriteLine("{0}", iOut.ToString());

#if DEBUG
        Console.WriteLine("続行するには何かキーを押してください．．．");
        Console.ReadKey();
#endif

    }

}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:6:22: error: 'string' has not been declared
    6 |     static void Main(string[] args)
      |                      ^~~~~~
a.cc:6:31: error: expected ',' or '...' before 'args'
    6 |     static void Main(string[] args)
      |                               ^~~~
a.cc:30:2: error: expected ';' after class definition
   30 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:9:13: error: 'string' was not declared in this scope
    9 |             string[] sInp = Console.ReadLine().Trim().Split(' ');
      |             ^~~~~~
a.cc:9:20: error: expected primary-expression before ']' token
    9 |             string[] sInp = Console.ReadLine().Trim().Split(' ');
      |                    ^
a.cc:10:13: error: 'List' was not declared in this scope
   10 |             List<int> lstTsk = new List<int>();
      |             ^~~~
a.cc:10:18: error: expected primary-expression before 'int'
   10 |             List<int> lstTsk = new List<int>();
      |                  ^~~
a.cc:11:33: error: 'sInp' was not declared in this scope
   11 |             for (int i = 0; i < sInp.Length; i++)
      |                                 ^~~~
a.cc:12:15: error: 'lstTsk' was not declared in this scope
   12 |             { lstTsk.Add(int.Parse(sInp[i])); }
      |               ^~~~~~
a.cc:12:26: error: expected primary-expression before 'int'
   12 |             { lstTsk.Add(int.Parse(sInp[i])); }
      |                          ^~~
a.cc:16:13: error: 'lstTsk' was not declared in this scope
   16 |             lstTsk.Sort();
      |             ^~~~~~
a.cc:21:13: error: 'Console' was not declared in this scope
   21 |             Console.WriteLine("{0}", iOut.ToString());
      |             ^~~~~~~
a.cc:21:43: error: request for member 'ToString' in 'iOut', which is of non-class type 'int'
   21 |             Console.WriteLine("{0}", iOut.ToString());
      |                                           ^~~~~~~~
Language: C

#include <stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:8:19: error: expected expression before '[' token
    8 |       scanf("%d",&[i]);
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
	int a,b,c;
	cin>>a>>b>>c;
	cout<<max(a,b,c)-min(a,b,c)<<endl;
	return 0;
}

Compiler output:
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:7:11:   required from here
    7 |         cout<<max(a,b,c)-min(a,b,c)<<endl;
      |               ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:7:22:   required from here
    7 |         cout<<max(a,b,c)-min(a,b,c)<<endl;
      |                          ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include<algorithm>
#include <cstdio>
#include<iostream>
using namespace std;
int main(){
int a[3];
cin>>a[0]>>a[1]>>a[2];
sort(a.begin(),a.end());
cout<<a[2]-a[0]<<endl;
return 0;
}

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

#include<algorithm>
#include <cstdio>
#include<iostream>
using namespace std;
int main(){
int a[3];
cin>>a[0]>>a[1]>>a[2];
Sort(a.begin(),a.end());
cout<<a[2]-a[0]<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: request for member 'begin' in 'a', which is of non-class type 'int [3]'
    8 | Sort(a.begin(),a.end());
      |        ^~~~~
a.cc:8:18: error: request for member 'end' in 'a', which is of non-class type 'int [3]'
    8 | Sort(a.begin(),a.end());
      |                  ^~~
a.cc:8:1: error: 'Sort' was not declared in this scope
    8 | Sort(a.begin(),a.end());
      | ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    int sum=max(a,b,c)-min(a,b,c);
    cout<<sum<<endl;
    return 0;
}




Compiler output:
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:7:16:   required from here
    7 |     int sum=max(a,b,c)-min(a,b,c);
      |             ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:7:27:   required from here
    7 |     int sum=max(a,b,c)-min(a,b,c);
      |                        ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

int main(){
    int a[3];
    for(int i = 0; i < 3;i++)cin >> a[i];
    sort(a,a+3);

    int ans = 0;
    for(int i = 1;i < 3; i++){
	ans += abs(a[i]-a[i-1]);#include<iostream>
#include<algorithm>
using namespace std;

int main(){
    int a[3];
    for(int i = 0; i < 3;i++)cin >> a[i];
    sort(a,a+3);

    int ans = 0;
    for(int i = 1;i < 3; i++){
	ans += abs(a[i]-a[i-1]);
    }
    cout << ans << endl;
    return 0;
}
#include<iostream>
#include<algorithm>
using namespace std;

int main(){
    int a[3];
    for(int i = 0; i < 3;i++)cin >> a[i];
    sort(a,a+3);

    int ans = 0;
    for(int i = 1;i < 3; i++){
	ans += abs(a[i]-a[i-1]);
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc:12:33: error: stray '#' in program
   12 |         ans += abs(a[i]-a[i-1]);#include<iostream>
      |                                 ^
a.cc: In function 'int main()':
a.cc:12:34: error: 'include' was not declared in this scope
   12 |         ans += abs(a[i]-a[i-1]);#include<iostream>
      |                                  ^~~~~~~
a.cc:12:50: error: expected primary-expression before '>' token
   12 |         ans += abs(a[i]-a[i-1]);#include<iostream>
      |                                                  ^
a.cc:14:1: error: expected primary-expression before 'using'
   14 | using namespace std;
      | ^~~~~
a.cc:16:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   16 | int main(){
      |         ^~
a.cc:16:9: note: remove parentheses to default-initialize a variable
   16 | int main(){
      |         ^~
      |         --
a.cc:16:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:11: error: a function-definition is not allowed here before '{' token
   16 | int main(){
      |           ^
a.cc:32:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   32 | int main(){
      |         ^~
a.cc:32:9: note: remove parentheses to default-initialize a variable
   32 | int main(){
      |         ^~
      |         --
a.cc:32:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:32:11: error: a function-definition is not allowed here before '{' token
   32 | int main(){
      |           ^
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:11:30: note: to match this '{'
   11 |     for(int i = 1;i < 3; i++){
      |                              ^
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
#define ll long  long
using namespace std;
int a[1000];

int main(){
    int  b[5];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    cout<<(a[2]-a[1]+a[1]-a[0])<<endl;
    return 0;
}
#include<bits/stdc++.h>
#define ll long  long
using namespace std;
int a[1000];

int main(){
    int  b[5];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    cout<<(a[2]-a[1]+a[1]-a[0])<<endl;
    return 0;
}


Compiler output:
a.cc:16:5: error: redefinition of 'int a [1000]'
   16 | int a[1000];
      |     ^
a.cc:4:5: note: 'int a [1000]' previously declared here
    4 | int a[1000];
      |     ^
a.cc:18:5: error: redefinition of 'int main()'
   18 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
#define ll long  long
using namespace std;
int a[1000];

int main(){
    int  b[5];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a,+n);
    cout<<(a[2]-a[1]+a[1]-a[0])<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'n' was not declared in this scope
    9 |     sort(a,a,+n);
      |               ^