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

#include<iostream>
#include<algorithm>
int MIN,MAX,n,sum,a;
int main(){
while(true){
cin>>n;if(!n){break;}
MIN=10000000;
MAX=0;sum=0;
for(i=0;i<n;i++){cin>>a;MIN=min(MIN,a);MAX=max(MAX,a);sum+=a;}
cout<<sum-MIN-MAX<<endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | cin>>n;if(!n){break;}
      | ^~~
      | 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:9:5: error: 'i' was not declared in this scope
    9 | for(i=0;i<n;i++){cin>>a;MIN=min(MIN,a);MAX=max(MAX,a);sum+=a;}
      |     ^
a.cc:9:29: error: 'min' was not declared in this scope; did you mean 'std::min'?
    9 | for(i=0;i<n;i++){cin>>a;MIN=min(MIN,a);MAX=max(MAX,a);sum+=a;}
      |                             ^~~
      |                             std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:9:44: error: 'max' was not declared in this scope; did you mean 'std::max'?
    9 | for(i=0;i<n;i++){cin>>a;MIN=min(MIN,a);MAX=max(MAX,a);sum+=a;}
      |                                            ^~~
      |                                            std::max
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 | cout<<sum-MIN-MAX<<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 | cout<<sum-MIN-MAX<<endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int MIN,MAX,n,sum,a;
int main(){
while(true){
cin>>n;if(!n){break;}
MIN=10000000;
MAX=0;sum=0;
for(i=0;i<n;i++){cin>>a;MIN=min(MIN,a);MAX=max(MAX,a);sum+=a;}
cout<<sum-MIN-MAX<<endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'i' was not declared in this scope
   10 | for(i=0;i<n;i++){cin>>a;MIN=min(MIN,a);MAX=max(MAX,a);sum+=a;}
      |     ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
 
int main() {
 
  while( true ) {
    long long int n;
    long long int a = 0;
    long long int b = 0;
    int input[100];
    cin >> n;
 
    if ( n == 0 ) break;
  
    for ( long long int i = 0; i < n; i++ ) {
 
      cin >> input[i];

      if (input[i] < a)
        a << input[i]

      if (input[i] > b)
        b << input[i] 
    }
 
    long long int ans = 0;
 
    for ( long long int i = 0; i < n; i++ ) {
 
      ans += s[i];
 
    }
 
    cout << (ans - a - b) / ( n - 2 ) << endl;
 
  }
 
  return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:22: error: expected ';' before 'if'
   22 |         a << input[i]
      |                      ^
      |                      ;
   23 | 
   24 |       if (input[i] > b)
      |       ~~              
a.cc:32:14: error: 's' was not declared in this scope
   32 |       ans += s[i];
      |              ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
 
int main() {
 
  while( true ) {
    long long int n;
    long long int a = 0;
    long long int b = 0;
    int input[100];
    cin >> n;
 
    if ( n == 0 ) break;
  
    for ( long long int i = 0; i < n; i++ ) {
 
      cin >> input[i];

      if (input[i] < a)
        a = input[i]

      if (input[i] > b)
        b = input[i] 
    }
 
    long long int ans = 0;
 
    for ( long long int i = 0; i < n; i++ ) {
 
      ans += s[i];
 
    }
 
    cout << (ans - a - b) / ( n - 2 ) << endl;
 
  }
 
  return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: expected ';' before 'if'
   22 |         a = input[i]
      |                     ^
      |                     ;
   23 | 
   24 |       if (input[i] > b)
      |       ~~             
a.cc:32:14: error: 's' was not declared in this scope
   32 |       ans += s[i];
      |              ^
Language: C++

#include<iostream>
 
using namespace std;
 
int main(){
    while( true ){
        int n;
        int ma = 0;
        int mi = 1000;
        int s = 0;
        cin >> n;

        if (n == 0){
            break;
        }

        int a[n];

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

            if (a[i] < mi){
                mi = a[i]
            }
            
            if (a[i] > ma){
                ma = a[i]
            }
        }

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

        cout << (s - ma - mi) / (n-2) << endl;

    }   
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:26: error: expected ';' before '}' token
   23 |                 mi = a[i]
      |                          ^
      |                          ;
   24 |             }
      |             ~             
a.cc:27:26: error: expected ';' before '}' token
   27 |                 ma = a[i]
      |                          ^
      |                          ;
   28 |             }
      |             ~
Language: C++

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

using namespace std;

struct CONTEST_DATA{
	int judgements;
	vector< int > points;
};

int main( void ){

	vector< CONTEST_DATA > contests;
	vector< int > answers;

	while( true ){
		CONTEST_DATA cd;
		cin >> cd.judgements;
		if( cd.judgements == 0 ){
			break;
		}
		int point;
		for( int i = 0; i < cd.judgements; i++ ){
			cin >> point;
			cd.points.push_back( point );
		}
		contests.push_back( cd );
	}

	for( int i = 0; i < contests.size(); ++i ){
		sort( contests[ i ].points.begin(), contests[ i ].points.end() );
	}
	for( int i = 0; i < contests.size(); ++i ){
		auto p = contests[i].points.begin;
		contests[ i ].points.erase( p );
	}
	for( int i = 0; i < contests.size(); ++i ){
		sort( contests[ i ].points.begin(), contests[ i ].points.end(), greater<int>() );
	}
	for( int i = 0; i < contests.size(); ++i ){
		auto p = contests[i].points.begin;
		contests[ i ].points.erase( p );
	}

	for( int i = 0; i < contests.size(); ++i ){
		int answer;
		for( int l = 0; l < contests[ i ].points.size(); ++l ){
			answer += contests[ i ].points[ l ];
		}
		answer / contests[ i ].judgements;
		answers.push_back( answer );
	}

	for( int i = 0; i < answers.size(); ++i ){
		cout << answers[ i ] << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:45: error: unable to deduce 'auto' from 'contests.std::vector<CONTEST_DATA>::operator[](((std::vector<CONTEST_DATA>::size_type)i)).CONTEST_DATA::points.std::vector<int>::begin'
   36 |                 auto p = contests[i].points.begin;
a.cc:36:45: note:   couldn't deduce template parameter 'auto'
   36 |                 auto p = contests[i].points.begin;
      |                                             ^~~~~
a.cc:43:45: error: unable to deduce 'auto' from 'contests.std::vector<CONTEST_DATA>::operator[](((std::vector<CONTEST_DATA>::size_type)i)).CONTEST_DATA::points.std::vector<int>::begin'
   43 |                 auto p = contests[i].points.begin;
a.cc:43:45: note:   couldn't deduce template parameter 'auto'
   43 |                 auto p = contests[i].points.begin;
      |                                             ^~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
int num,temp;

while(1){
   cin>>num;
   if(num==0){
   break;
   }
   int min=10000000,max=0,sum=0;
   for(int i=0;i<num;i++){
   cin>>temp;
   if(min>temp)min=temp;
   if(max<temp)max=temp;
   sum+=temp;
   }
   sum=sum-max-min;
   cout<<sum/(num-2)<<endl;
}

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

#include <iostream>
using namespace std;

int main(){
        int i = 0;
        
        while(cin >> i && !(i == 0)){
                int a[i];
                int j = 0;              

                for(j=0; j<i; j++){
                        cin >> a[j];
                }
                cout << endl;           
        
                //sum
                int sum = 0;
                for (j=0; j<i; j++) {
                        sum += a[j];
                }
        
                //largest,smallest
                int largest = 0;
                int smallest = 1000;
                for (j=0; j<i; j++){
                        if (a[j] > largest)
                                largest = a[j];
                        else if (a[j] < smallest)
                                smallest = a[j];
                }
                
                //average
                int average = 0;
                average = (sum - largest - smallest) / (i - 2);
                cout << average;
        }

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

#include <iostream>

using namespace std;

int main(){
	while (cin >> n && n > 0){
		int large = 0;
		int small = 1000;
		int sum = 0;
		for (int i=0; i>n; ++i){
			cin >> s;
			sum = sum + s;
			if (large < s) {large = s};
			if (small > s) {small = s};
		}
		int ans = 0;
		ans = (sum - large - small) / (n - 2);
		cout << ans << endl ;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: 'n' was not declared in this scope
    6 |         while (cin >> n && n > 0){
      |                       ^
a.cc:11:32: error: 's' was not declared in this scope
   11 |                         cin >> s;
      |                                ^
Language: C++

#include <iostream>

using namespace std;

int main(){
	while (cin >> n && n > 0){
		int large = 0;
		int small = 1000;
		int sum = 0;
                int n, s ;
  		for (int i=0; i>n; ++i){
			cin >> s;
			sum = sum + s;
			if (large < s) {large = s};
			if (small > s) {small = s};
		}
		int ans = 0;
		ans = (sum - large - small) / (n - 2);
		cout << ans << endl ;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: 'n' was not declared in this scope
    6 |         while (cin >> n && n > 0){
      |                       ^
a.cc:14:50: error: expected ';' before '}' token
   14 |                         if (large < s) {large = s};
      |                                                  ^
      |                                                  ;
a.cc:15:50: error: expected ';' before '}' token
   15 |                         if (small > s) {small = s};
      |                                                  ^
      |                                                  ;
Language: C++

#include <iostream>

using namespace std;

int main(){
	while (cin >> n && n > 0){
		int large = 0;
		int small = 1000;
		int sum = 0;
                int n, s ;
  		for (int i=0; i>n; ++i){
			cin >> s;
			sum = sum + s;
			if (large < s) {large = s};
			if (small > s) {small = s};
		};
		int ans = 0;
		ans = (sum - large - small) / (n - 2);
		cout << ans << endl ;
	};
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: 'n' was not declared in this scope
    6 |         while (cin >> n && n > 0){
      |                       ^
a.cc:14:50: error: expected ';' before '}' token
   14 |                         if (large < s) {large = s};
      |                                                  ^
      |                                                  ;
a.cc:15:50: error: expected ';' before '}' token
   15 |                         if (small > s) {small = s};
      |                                                  ^
      |                                                  ;
Language: C++

#include <iostream>

using namespace std;

int main(){
        int n, s ;
	while (cin >> n && n > 0){
		int large = 0;
		int small = 1000;
		int sum = 0;
  		for (int i=0; i>n; ++i){
			cin >> s;
			sum = sum + s;
			if (large < s) {large = s};
			if (small > s) {small = s};
		};
		int ans = 0;
		ans = (sum - large - small) / (n - 2);
		cout << ans << endl ;
	};
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:50: error: expected ';' before '}' token
   14 |                         if (large < s) {large = s};
      |                                                  ^
      |                                                  ;
a.cc:15:50: error: expected ';' before '}' token
   15 |                         if (small > s) {small = s};
      |                                                  ^
      |                                                  ;
Language: C++

#include <iostream>

using namespace std;

int main(){
        int n, s ;
	while (cin >> n && n > 0){
		int large = 0;
		int small = 1000;
		int sum = 0;
  		for (int i=0; i>n; ++i){
			cin >> s;
			sum = sum + s;
			if (large < s) {large = s};
			if (small > s) {small = s};
		}
		int ans = 0;
		ans = (sum - large - small) / (n - 2);
		cout << ans << endl ;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:50: error: expected ';' before '}' token
   14 |                         if (large < s) {large = s};
      |                                                  ^
      |                                                  ;
a.cc:15:50: error: expected ';' before '}' token
   15 |                         if (small > s) {small = s};
      |                                                  ^
      |                                                  ;
Language: C++

#include <iostream>

using namespace std;

int main(){
        int n, s ;
	while (cin >> n && n > 0){
		int large = 0;
		int small = 1000;
		int sum = 0;
  		for (int i=0; i>n; ++i){
			cin >> s;
			sum = sum + s;
			if (large < s) {large = s}
			if (small > s) {small = s}
		}
		int ans = 0;
		ans = (sum - large - small) / (n - 2);
		cout << ans << endl ;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:50: error: expected ';' before '}' token
   14 |                         if (large < s) {large = s}
      |                                                  ^
      |                                                  ;
a.cc:15:50: error: expected ';' before '}' token
   15 |                         if (small > s) {small = s}
      |                                                  ^
      |                                                  ;
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  int n,i;
  cin >> n;
  while(n!=0){
    int score[101];
    for(i=0;i<n;i++) cin >> score[i];
    sort(score,score+n);
    int sum=0;
    for(i=1;i<n-1;i++) sum+=score[i];
    cout << sum/(n-2) << endl;
    cin >> n;
  }
  
  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(score,score+n);
      |     ^~~~
      |     short
Language: C++

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

int main(){
	int n;

	while (cin >> n, n){
		int a[100], sum = 0;
		for (int i = 0; i < n; i++){
			cin >> a[i];
		}
		int sum = accumulate(a, a + n, 0);
		int Max = *max_element(a, a + n);
		int Min = *min_element(a, a + n);
		cout << (sum - (Max + Min)) / (n - 2) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: redeclaration of 'int sum'
   14 |                 int sum = accumulate(a, a + n, 0);
      |                     ^~~
a.cc:10:29: note: 'int sum' previously declared here
   10 |                 int a[100], sum = 0;
      |                             ^~~
Language: C++

#include <iostream>

#define el endl
#define fd fixed

using namespace std;

int main() {
  while (1) {
    int n;
    cin >> n;
    int m = n;
    if (n == 0) break;
    int max = INT_MIN;
    int min = INT_MAX;
    int ave = 0;
    while (m--) {
      int x;
      cin >> x;
      ave += x;
      if (x < min) min = x;
      if (x > max) max = x;
    }
    ave = ave - (max + min);
    ave = ave / (n-2);
    cout << ave << el;
  }
}

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

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x*x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int getAverageScore(int N, VI S){
	int min = S[0];
	int max = S[0];
	int sum = 0;
	FOR(i, 1, N){
		sum += S[i];
		if (min > S[i]){ min = S[i]; }
		if (max < S[i]){ max = S[i]; }
	}
	sum -= (min + max);
	return sum / N;
}
int main(){
	int N;
	VI S;
	int b;
	int c = INT_MAX;
	while (true){
		if (c != INT_MAX){ cout << endl; }
		cin >> N;
		if (N == 0){ break; }
		REP(i, N){
			cin >> b;
			S.push_back(b);
		}
		c = getAverageScore(N, S);
		cout << c;
		S.clear();
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:88:17: error: 'INT_MAX' was not declared in this scope
   88 |         int c = INT_MAX;
      |                 ^~~~~~~
a.cc:24:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   23 | #include <ctime>
  +++ |+#include <climits>
   24 |
Language: C++

#include<iostream>
#include<vector>

int main(void)
{


  int score[100];
  int sum, avg, i, n,tmp,j, count=0;
  while(1)
    {
      cin>>n;
      score[count]=n;
      count++;
      if(n<=0) {
        count-=1;
        break;
      }
    }
  //input
 for(i=0;i<count; i++){
    for(j=i+1; j<count; j++){
      if(score[i]>score[j]){
        tmp=number[i];
        number[i]=number[j];
        number[j]=tmp;
      }
    }
  }
  //sort
for(i=1; i<count-1; i++)
        {
          sum+=score[i];
          avg=sum/i;
        }
 cout<<avg;

       }
//output
  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |       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:24:13: error: 'number' was not declared in this scope
   24 |         tmp=number[i];
      |             ^~~~~~
a.cc:36:2: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   36 |  cout<<avg;
      |  ^~~~
      |  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:40:3: error: expected unqualified-id before 'return'
   40 |   return 0;
      |   ^~~~~~
a.cc:42:1: error: expected declaration before '}' token
   42 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main() {int n,i,a,b,max,min,sum,answer;
while(cin >> n, n ) {
i =2;
cin >> a;
max=a;
min=a;
sum =a;
while(i<=n)
{cin >> b;
if(b>max){max=b;}
if(b<min){min=b;}
sum = sum+b;
i++;
}
//if(b==0){break;}
answer=(sum-max-min)/(n-2);
cout << answer << endl;

	// your code goes here
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {int n,i,a,b,max,min,sum,answer;
      |            ^
Language: C++

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

int main(){
	int n;
	while(n!=0){
		cin>>n;
		if(n==0){
			break;
		}
		vector<int> score;
		int hoge;
		for(int i=0;i<n;i++){
			cin>>hoge;
			score.push_back(hoge);
		}
		sort(score.begin(), score.end());
		int sum=0;
		for(int i=1;i<n-1;i++){
			sum += score[i];
		}
		cout<<sum/(n-2)<<endl;
	}
}	

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

int main()
{
    int n;
    while(1){
        cin >> x;
        if(x == 0) break;
        int max = -1, mini = 10000, sum = 0, ten = 0, y = 0;
        for(int i = 0; i < n; i++){
            cin >> ten;
            sum += ten;
            if(ten > max) max = ten;
            if(ten < mini) mini = ten;
        }
        sum -= max + mini;
        y = sum / (x - 2);
        cout << y << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> x;
      |         ^~~
a.cc:5:16: error: 'x' was not declared in this scope
    5 |         cin >> x;
      |                ^
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << y << endl;
      |         ^~~~
a.cc:16:22: error: 'endl' was not declared in this scope
   16 |         cout << y << endl;
      |                      ^~~~
Language: C++

int main()
{
    int n;
    while(1){
        cin >> x;
        if(x == 0) break;
        int max = -1, mini = 10000, sum = 0, ten = 0, y = 0;
        for(int i = 0; i < x; i++){
            cin >> ten;
            sum += ten;
           
            if(ten < mini) mini = ten;
	    if(ten > max) max = ten;
        }
        sum -= max + mini;
        y = sum / (x - 2);
        cout << y << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> x;
      |         ^~~
a.cc:5:16: error: 'x' was not declared in this scope
    5 |         cin >> x;
      |                ^
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout << y << endl;
      |         ^~~~
a.cc:17:22: error: 'endl' was not declared in this scope
   17 |         cout << y << endl;
      |                      ^~~~
Language: C++

int main()
{
    int n;
    while(1){
        cin >> x;
        if(x == 0) break;
        int max = -1, mini = 10000, sum = 0, ten = 0, y = 0;
        for(int i = 0; i < x; i++){
            cin >> ten;
            sum += ten;
       	    if(ten > max) max = ten;
            if(ten < mini) mini = ten;
	    
        }
        sum -= max + mini;
        y = sum / (x - 2);
        cout << y << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> x;
      |         ^~~
a.cc:5:16: error: 'x' was not declared in this scope
    5 |         cin >> x;
      |                ^
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout << y << endl;
      |         ^~~~
a.cc:17:22: error: 'endl' was not declared in this scope
   17 |         cout << y << endl;
      |                      ^~~~
Language: C++

int main()
{
    int n;
    while(1){
        cin >> n;
        if(n == 0) break;
        int max = -1, min = 10000, sum = 0, score = 0, ans = 0;
        for(int i = 0; i < n; i++){
            cin >> score;
            sum += score;
            if(score > max) max = score;
            if(score < min) min = score;
        }
        sum -= max + min;
        ans = sum / (n - 2);
        cout << ans << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> n;
      |         ^~~
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << ans << endl;
      |         ^~~~
a.cc:16:24: error: 'endl' was not declared in this scope
   16 |         cout << ans << endl;
      |                        ^~~~
Language: C++

#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>

using namespace std;


int main()
{
    int n;
    while(1){
        cin >> x;
        if(x == 0) break;
        int max = -1, mini = 10000, sum = 0, ten = 0, y = 0;
        for(int i = 0; i < x; i++){
            cin >> ten;
            sum += ten;
       	    if(ten > max) max = ten;
            if(ten < mini) mini = ten;
	    
        }
        sum -= max + mini;
        y = sum / (x - 2);
        cout << y << endl;
    }
    return 0;
}

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

#include <stdio.h>
int main()
{
    int n;
    while(1){
        cin >> n;
        if(n == 0) break;
        int max = -1, min = 10000, sum = 0, score = 0, ans = 0;
        for(int i = 0; i < n; i++){
            cin >> score;
            sum += score;
            if(score > max) max = score;
            if(score < min) min = score;
        }
        sum -= max + min;
        ans = sum / (n - 2);
        cout << ans << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> n;
      |         ^~~
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout << ans << endl;
      |         ^~~~
a.cc:17:24: error: 'endl' was not declared in this scope
   17 |         cout << ans << endl;
      |                        ^~~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
    int x;
    while(1){
        cin >> x;
        if(x == 0) break;
        int max = -1, mini = 10000, sum = 0, score = 0, y = 0;
        for(int i = 0; i < x; i++){
           cin >> score;
          sum += score;
          if(score > max) max = score;
            if(score < mini) mini = score;
        }
        sum -= max + mini;
        y = sum / (n - 2);
        cout << y << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: 'n' was not declared in this scope
   18 |         y = sum / (n - 2);
      |                    ^
Language: C++

#include <iostream>
using namespace std;
int main(){
bool test = true;
int num;
while(test)
{
int ans = 0;
cin >> num;
if(num != 0)
{
int a[num];
for(int i = 0;i<num;i++)
{
 cin >> a[i];
}
sort(a, a + num);
for(int i=1; i<num-1;i++)
{
ans += a[i];
}
cout << ans << endl;
}
else
{
return 0;
}
}
}

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

#include <iostream>
using namespace std;
class Score{
private:
	int shinpan;
	int score[100];
	int max;
	int min;
	int ave;
public:
	Score();
	//????????????????????¨????????????????????¨???
	void Reset();
	//???????????°?????\???
	void InputShinpan(int n){shinpan = n;}
	//?????°??????????????°?????¨?????\?????????
	void InputScore();
	//????????????????????????????????????????????°?????????
	int ReturnAverage();
};
Score::Score(){
	max=INT_MIN;
	min=INT_MAX;
	ave=0;
	shinpan=0;
	for(int i=0;i<100;i++){
		score[i] = INT_MIN;
	}
}
void Score::Reset(){
	max=INT_MIN;
	min=INT_MAX;
	ave=0;
	shinpan=0;
	for(int i=0;i<100;i++){
		score[i] = INT_MIN;
	}
}
void Score::InputScore(){
	for(int i=0;i<shinpan;i++){
		cin >> score[i];
	}
}
int Score::ReturnAverage(){
	for(int i=0;i<shinpan;i++){
		ave += score[i];
		if(score[i]>max){
			max = score[i];
		}
		if(score[i]<min){
			min = score[i];
		}
	}
	ave -= max;
	ave -= min;
	ave = ave / (shinpan - 2);
	return ave;
}
int main()
{
	int n;
	int i;
	Score score;
	while(cin>>n,n!=0){//???????????°?????\??? ?????§??????
		score.InputShinpan(n);
		score.InputScore();
		cout << score.ReturnAverage() << endl;
		score.Reset();
	}
	cin.get();
	return 0;
}

Compiler output:
a.cc: In constructor 'Score::Score()':
a.cc:22:13: error: 'INT_MIN' was not declared in this scope
   22 |         max=INT_MIN;
      |             ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | using namespace std;
a.cc:23:13: error: 'INT_MAX' was not declared in this scope
   23 |         min=INT_MAX;
      |             ^~~~~~~
a.cc:23:13: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc: In member function 'void Score::Reset()':
a.cc:31:13: error: 'INT_MIN' was not declared in this scope
   31 |         max=INT_MIN;
      |             ^~~~~~~
a.cc:31:13: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc:32:13: error: 'INT_MAX' was not declared in this scope
   32 |         min=INT_MAX;
      |             ^~~~~~~
a.cc:32:13: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

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


int main()
{
	int n, s[101];
	while (cin >>n &&n> 0) {
		int mean = 0;
		for (int i = 0; i < n; i++) cin >> s[i];
		sort(s, s + n);
		for (int i = 1; i < n - 1; i++)mean += s[i];
		cout << mean << endl;
	}
    return 0;
}

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

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

int main(){
	int d,e;
	while(cin>>d>>e,d){
		double res=10000000;
		for(int i=0;i<=d;i++){
			int j=d-i;
			res=min(res,abs(sqrt(double(int(i*i+j*j)))-e));

		}
		cout<<res<<endl;


	}


}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:41: error: 'sqrt' was not declared in this scope
   12 |                         res=min(res,abs(sqrt(double(int(i*i+j*j)))-e));
      |                                         ^~~~
Language: C++

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

struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef queue<int> qi;
typedef stack<int> si;
typedef deque<int> dqi;

#define reps(i, a, b) for (int i = a; i < b; ++i)
#define rep(i, n) reps(i, 0, n)
#define REPS(i, a, b) reps(i, a, b)
#define REP(i, n) rep(i, n)
#define deps(i, a, b) for (int i = a; i >= b; --i)
#define dep(i, n) deps(i, n, 0)
#define DEPS(i, a, b) deps(i, a, b)
#define DEP(i, n) dep(i, n)

#define pf push_front
#define pb push_back
#define mp make_pair
#define fst first
#define FST fst
#define sec second
#define SEC sec
#define sz(obj) ((int)(obj).size())
#define all(v) (v).begin(), (v).end()
#define ALL(v) all(v)

const int INF = 999999999;
const int MOD = 1e9 + 7;
const int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; std::cin >> x; return x;}
template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << endl;
}
template <typename T> void print(T x) { std::cout << x << '\n'; }

signed main()
{
  while (int n = in(), n){
    vi v;
    int sum = 0;

    rep(i, n) v.pb(in());
    sort(all(v));
    for (int i = 1; i < n - 1; i++) sum += v[i];
    print(sum / (n - 2));
  }

  return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:22: error: expected ')' before ',' token
   52 |   while (int n = in(), n){
      |         ~            ^
      |                      )
a.cc:52:22: error: expected primary-expression before ',' token
Language: C++

#include <iostream>
#include<algorithm>
using namespase std;
int main(){
int n;
cin>>n;
int sum =0;
int ma =0;
int mi =100000;
int cnt =0;
for(int i=0;i<n;i++){int s;cin>>s;sum+=s;ma =max(ma,s);mi=min(mi,s);cnt++;}
cout<<(sum-mi-ma)/(cnt-2)<<endl
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namespase'
    3 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | 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:11:46: error: 'max' was not declared in this scope; did you mean 'std::max'?
   11 | for(int i=0;i<n;i++){int s;cin>>s;sum+=s;ma =max(ma,s);mi=min(mi,s);cnt++;}
      |                                              ^~~
      |                                              std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:11:59: error: 'min' was not declared in this scope; did you mean 'std::min'?
   11 | for(int i=0;i<n;i++){int s;cin>>s;sum+=s;ma =max(ma,s);mi=min(mi,s);cnt++;}
      |                                                           ^~~
      |                                                           std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:12:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 | cout<<(sum-mi-ma)/(cnt-2)<<endl
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 | cout<<(sum-mi-ma)/(cnt-2)<<endl
      |                            ^~~~
      |                            std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

using namespace std;

int main(){
	int n;
	int total;
	int ave;

	while(1){
		vector<int> v;
		cin>>n;
		if(n==0)break;

		for(int i=0;i<n;i++){
			cin>>tmp;
			v.push_back(tmp);
		}

		sort(v.begin(),v.end());

		total=0;
		for(int i=0;i<n;i++){
		total+=v[i];
		}

		total=total-(v[0]+v[n-1]);
		ave=total/(n-2);
		
		cout<<ave<<endl;
		
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   18 |                         cin>>tmp;
      |                              ^~~
      |                              tm
Language: C++

loop do
  l = gets.to_i
  exit if l == 0
  m = l.times.map{gets.to_i}
  puts (m.reduce(:+) - m.minmax.reduce(:+)) / (l - 2)
end

Compiler output:
a.cc:1:1: error: 'loop' does not name a type
    1 | loop do
      | ^~~~
a.cc:5:8: error: expected constructor, destructor, or type conversion before '(' token
    5 |   puts (m.reduce(:+) - m.minmax.reduce(:+)) / (l - 2)
      |        ^
Language: C++

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			int sum=0,i,max=0,min=1000,ave;
			int n=sc.nextInt();
			if(n==0){
				break;
			}
			for(i=0;i<n;i++){
				int point=sc.nextInt();
				if(point<min){
					min=point;
				}
				if(point>max){
					max=point;
				}
				sum=sum+point;
			}
			ave=(sum-max-min)/(n-2);
			System.out.println(ave);
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include<algorithm>
using namespace std; 
int main(){
  int n;  
  while(cin>>n&&n!=0){
    cin>>n;
    int a[]={};
    int sum=0;
    for(int i=0;i<n;i++){    
      int b;
      cin>>b;
      a[i]=b;
      sum+=b;
    }
    sort(a,a+n);
    sum-=a[0];
    sum-=a[n-1];
    cout<<sum/(n-2)<<endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |   while(cin>>n&&n!=0){
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<algorithm>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout<<sum/(n-2)<<endl;
      |     ^~~~
a.cc:18:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:22: error: 'endl' was not declared in this scope
   18 |     cout<<sum/(n-2)<<endl;
      |                      ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<algorithm>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

# coding: utf-8

import sys

if __name__ == '__main__':
    while 1:
        n = int(input())
        if n == 0:
            break
        a = [int(input()) for i in range(n)]
        print((sum(a) - min(a) - max(a)) // (n-2));

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:5:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    5 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:3:1: error: 'import' does not name a type
    3 | import sys
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n, a[100], s;
  while(cin >> n,n){
    s=0;
    for(int i = 0;i < n;i ++){
      cin >> a[i];
    }
    sort(a,a+n);
    for(int i = 1;i < n-1;i ++){
      s += a[i];
    }
    cout << s/(n-2)<< endl;
  }
  return 0;
}

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

#include<iostream>
#include<algorithm>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define PII pair<int,int>
#define PCC pair<char,char>
#define PCI pair<char,int>
#define PIC pair<int,char>
#define MP make_pair
#define DEBUG(x) cout<<#x<<": "<<x<<endl;

int main()
{
	int n;
	for (; cin >> n, n != 0;)
	{
		int Min = INF;
		int Max = -1;
		int sum = 0;
		REP(i, n)
		{
			int temp;
			cin >> temp;
			Min = min(Min, temp);
			Max = max(Max, temp);
			sum += temp;
		}
		sum =sum - Min - Max;
		int ans = sum / (n-2);
		cout <<ans<< endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'INT_MAX' was not declared in this scope
    6 | #define INF INT_MAX/3
      |             ^~~~~~~
a.cc:20:27: note: in expansion of macro 'INF'
   20 |                 int Min = INF;
      |                           ^~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include<algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <queue>
#include <numeric>
using namespace std;

int main(){

	int n;
	while(cin >> n, n){
		vector<int> score;
		for(int i=0; i<n; i++){
			int s; cin >> s;
			score.push_back(s);
		}
		sort(score.begin(), score.end());
		int sum = accumulate(score.begin(), score.end(),0);
		cout << ( sum - score.back() - score.front() )/ (score.size()-2) << endl;
	}

	return 0;
}

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

int main()
{
	//n: ??????????????°
	int n, point[100], sum = 0, ave = 0, max = 0, min = 0;
	while( cin >> n && n != 0){

		for(int i = 0; i < n; i++)
			cin >> point[i];

		sort(point, point + n);

		/*
		for(int i = 0; i < n; i++)
			cout << "Point: " << point[i] << " ";
		cout << endl;*/

		for(int i = 1; i < n-1; i++){
			sum += point[i];
		}
		ave = sum / (n-2);
		//cout << "Ave: ";
		cout << ave << endl;

		sum = 0;
		ave = 0;
		min = 0;
		max = 0;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: 'cin' was not declared in this scope; did you mean 'min'?
    5 |         while( cin >> n && n != 0){
      |                ^~~
      |                min
a.cc:10:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |                 sort(point, point + n);
      |                 ^~~~
      |                 short
a.cc:22:17: error: 'cout' was not declared in this scope
   22 |                 cout << ave << endl;
      |                 ^~~~
a.cc:22:32: error: 'endl' was not declared in this scope
   22 |                 cout << ave << endl;
      |                                ^~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

int main() {
	int c[20];   // int[] c = new int[20];
	int w = 0;
	while (true)
	{
		int a;
		cin >>  a;// int a = int.Parse(Console.ReadLine());
		if (a == 0)
			break;
		int sum = 0;
		int b[a];
		for (int j = 0; j < a; j++)
		{
			cin >> b[j];
			sum += b[j];
		}
		sum -= b.Max() + b.Min();
		c[w] = (sum / (a - 2));
		w++;
	}
	for (int j = 0; j<w; j++)
	{
		cout << c[j] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:26: error: request for member 'Max' in 'b', which is of non-class type 'int [a]'
   42 |                 sum -= b.Max() + b.Min();
      |                          ^~~
a.cc:42:36: error: request for member 'Min' in 'b', which is of non-class type 'int [a]'
   42 |                 sum -= b.Max() + b.Min();
      |                                    ^~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

int main() {
	int c[20];   // int[] c = new int[20];
	int w = 0;
	while (true)
	{
		int a;
		cin >>  a;// int a = int.Parse(Console.ReadLine());
		if (a == 0)
			break;
		int sum = 0;
		int b[a];
		for (int j = 0; j < a; j++)
		{
			cin >> b[j];
			sum += b[j];
		}
		int maxi = 0; mini = 1000000000;
		for (int j = 0; j < a; j++) {
			if (maxi < b[j])
				maxi = b[j];
			if (mini > b[j])
				mini = b[j];
		}
		sum -= maxi + mini;
		c[w] = (sum / (a - 2));
		w++;
	}
	for (int j = 0; j<w; j++)
	{
		cout << c[j] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:31: error: 'mini' was not declared in this scope
   42 |                 int maxi = 0; mini = 1000000000;
      |                               ^~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n;
  while(cin>>n){
    if(n==0){return 0;}
    int s[n];
    for(int i=0;i<n;i++){
      cin>>p[i];
    }
    sort(p,p+n);
    int ans=0;
    for(int i=1;i<n-1;i++){
      ans+=p[i];
    }
    cout<<ans/(n-2)<<endl;
  }
  return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'p' was not declared in this scope
   10 |       cin>>p[i];
      |            ^
a.cc:12:10: error: 'p' was not declared in this scope
   12 |     sort(p,p+n);
      |          ^