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

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

class Parsing
{
private:
  string parse;
  int pos;
  int size;
  int x;
public:

  Parsing(string parse,int x):parse(parse),pos(0),x(x),size(0){}

  int StringToInt(string v)
  {
    int ret = 0;
    for(int i=0;i<v.size();i++)
      ret += (v[i]-'0')*(int)pow(10.0,v.size()-i-1);
    return ret;
  }

  string getCnt()
  {
    string v;
    while('0' <= parse[pos] && parse[pos] <= '9') 
      v += parse[pos++];
    return v;  
  }

  int getCntInt(){return StringToInt(getCnt());}

  string decode()
  {
    int power = getCntInt();
    if(parse[pos] == '(')
      pos++;
    else 
      {
	string mes,ret;
	while('A' <= parse[pos] && parse[pos] <= 'Z')	
	  mes += parse[pos++];
	
	for(int i=0;i<power;i++)
	  {
	    ret += mes;
	    if(ret.size() >= x)
	      break;
	  }
	return ret;	  
      }
    string message;
    while(('0' <= parse[pos] && parse[pos] <= '9') || ('A' <= parse[pos] && parse[pos] <= 'Z') )
      {
	if('0' <= parse[pos] && parse[pos] <= '9')
	  message += decode();
	else if('A' <= parse[pos] && parse[pos] <= 'Z')
	  message += parse[pos++];
      }  
    
    if(parse[pos] == ')')
      pos++;
    
    string ret;
    for(int i=0;i<power;i++)
      {
	ret += message,size += message.size();
	if(ret.size() >= x)
	  break;
      }
    return ret;
  }
  
  string exp()
  {
    string ret;
    for(;pos<parse.size();)
      {
	if('0' <= parse[pos] && parse[pos] <= '9')
	  ret += decode();
	else
	  ret += parse[pos++],size++;
	if(ret.size() >= x)
	  break;
      }
    return ret;
  }

  int getSize()
  {
    return size;
  }

};

int main()
{
  string Genome;  
  int pos;
  while(cin >> Genome >> pos, Genome != "0" || pos != 0)
    {
      Parsing par = Parsing(Genome,pos+1);
      string message = par.exp();
      if(message.size() <= pos)
	cout << 0 << endl
	else
	  cout << message[pos] << endl;
    }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:107:26: error: expected ';' before 'else'
  107 |         cout << 0 << endl
      |                          ^
      |                          ;
  108 |         else
      |         ~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
extern "C" {
#include "quadmath.h"
}

using namespace std;

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

typedef __float128 D;

const D PI = acosq(-1);

int n;
D x[100], y[100];

D solve(D theta) {
  vector<D> xx;
  rep (i, n) xx.push_back(x[i] * sinq(theta) + y[i] * cosq(theta));
  sort(xx.begin(), xx.end());
  D res = 2;
  rep (i, xx.size() - 1) res += min((D)2, xx[i + 1] - xx[i]);
  return res;
}

int main() {
  while (true) {
    cin >> n;
    if (n == 0) break;
    rep (i, n) {
      //char xs[80], ys[80];
      string xs, ys;
      cin >> xs >> ys;
      x[i] = strtoflt128(xs.c_str(), NULL);
      y[i] = strtoflt128(ys.c_str(), NULL);
    }
    vector<D> t;
    t.push_back(PI);
    t.push_back(0);
    rep (i, n) rep (j, i) {
      D t1 = -atan2q(y[i] - y[j], x[i] - y[j]);
      D dt = asinq((D)2 / sqrtq(powq(x[i] - x[j], 2) + powq(y[i] - y[j], 2)));
      t.push_back(t1);
      t.push_back(t1 + dt);
      t.push_back(t1 - dt);
    }
    rep (i, t.size()) while (t[i] < 0) t[i] += PI;
    rep (i, t.size()) while (t[i] > PI) t[i] -= PI;
    sort(t.begin(), t.end());
    //rep (i, t.size()) cerr << t[i] << endl;
    D ans = 0, r = 1e9;
    rep (i, t.size() - 1) {
      D lower = t[i];
      D upper = t[i + 1];
      rep (_, 100) {
	D mid1 = lower * 2 / 3 + upper / 3;
	D mid2 = lower / 3 + upper * 2 / 3;
	D s1 = solve(mid1);
	D s2 = solve(mid2);
	if (s1 > s2) lower = mid1;
	else upper = mid2;
	if (r > s1) {
	  ans = mid1;
	  r = s1;
	}
	if (r > s2) {
	  ans = mid2;
	  r = s2;
	}
      }
    }
    char c[256];
    quadmath_snprintf(c, 256, "%.15Qf", ans);
    puts(c);
    ans = 0, r = 0;
    rep (i, t.size() - 1) {
      D lower = t[i];
      D upper = t[i + 1];
      rep (_, 100) {
	D mid1 = lower * 2 / 3 + upper / 3;
	D mid2 = lower / 3 + upper * 2 / 3;
	D s1 = solve(mid1);
	D s2 = solve(mid2);
	if (s1 > s2) upper = mid2;
	else lower = mid1;
	if (r < s1) {
	  ans = mid1;
	  r = s1;
	}
	if (r < s2) {
	  ans = mid2;
	  r = s2;
	}
      }
    }
    quadmath_snprintf(c, 256, "%.15Qf", ans);
    puts(c);
  }
}

Compiler output:
/usr/bin/ld: /tmp/cc5tPzzA.o: in function `solve(__float128)':
a.cc:(.text+0x56): undefined reference to `sinq'
/usr/bin/ld: a.cc:(.text+0x9a): undefined reference to `cosq'
/usr/bin/ld: /tmp/cc5tPzzA.o: in function `main':
a.cc:(.text+0x2d2): undefined reference to `strtoflt128'
/usr/bin/ld: a.cc:(.text+0x305): undefined reference to `strtoflt128'
/usr/bin/ld: a.cc:(.text+0x42f): undefined reference to `atan2q'
/usr/bin/ld: a.cc:(.text+0x490): undefined reference to `powq'
/usr/bin/ld: a.cc:(.text+0x4e5): undefined reference to `powq'
/usr/bin/ld: a.cc:(.text+0x4fb): undefined reference to `sqrtq'
/usr/bin/ld: a.cc:(.text+0x511): undefined reference to `asinq'
/usr/bin/ld: a.cc:(.text+0x929): undefined reference to `quadmath_snprintf'
/usr/bin/ld: a.cc:(.text+0xb7c): undefined reference to `quadmath_snprintf'
/usr/bin/ld: /tmp/cc5tPzzA.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0xbff): undefined reference to `acosq'
collect2: error: ld returned 1 exit status
Language: Java

import java.util.*;
class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		while(true){
			int a = sc.nextInt();
			if(a == 0){break;}
			int total = 0;
			int syo = 1000;
			int dai = 0;

		for(int n = 0; n < a; n++){
			int tmp = sc.nextInt();
			total = total + tmp;
			if(tmp < syo){
				 syo = tmp;
			}else if(tmp > dai){
				dai = tmp;
			}
		}
		System.out.println(heikin);

		}

	}
}
		


Compiler output:
Main.java:21: error: cannot find symbol
		System.out.println(heikin);
		                   ^
  symbol:   variable heikin
  location: class Main
1 error
Language: Java

import java.util.*;

/**
 * ICPCScoreTotalizerSoftware
 */
public class　Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int n = sc.nextInt();
            if (n == 0)
                break;

            List<Integer> list = new ArrayList<Integer>();

            for (int i = 0; i < n; i++) {
                int num = sc.nextInt();
                list.add(num);
            }

            Collections.sort(list);
            list.remove(0);
            list.remove(list.size() - 1);
            // 最初と最後をカットして平均切り捨てしゅつりょく
            int ans = 0;
            for (int i : list) {
                ans += i;
            }

            System.out.println(ans / list.size());
        }
    }
}


Compiler output:
Main.java:6: error: illegal character: '\u3000'
public class?Main {
            ^
1 error
Language: Java

import java;
public class Main{
    public static void main(String[] args){
    int n;
    Scanner sc =new Scanner(System.in);
    n = sc.nextInt();
    if(n==0){
        exit(1);
    }
    int[] s;
    int i=0;
    int max=0;
    int min=1000;
    while(i<n){
        s[i]=sc.nextInt();
        if(s[i]>max){
            max=s[i];
        }
        if(s[i]<min){
            min=s[i];
        }    
        i++;
    }
    int sum=0;
    i=0;
    int c=0;
    int c2=0;
    while(i<n){
        if(s[i]!=min && s[i]!=max){
            sum+=s[i];
        }else if(s[i]==max){
            c++;
        }else if(s[i]==min){
            c2++;
        }
        i++;
    }    
    sum+=max*(c-1);
    sum+=min*(c2-1);
    int average=0;
    average=sum/(n-2);
    SyStem.out.println(agerage);
    }
}


Compiler output:
Main.java:1: error: '.' expected
import java;
           ^
1 error
Language: Java

import java.util; 
public class Main{
    public static void main(String[] args){
    int n;
    Scanner sc =new Scanner(System.in);
    n = sc.nextInt();
    if(n==0){
        exit(1);
    }
    int[] s;
    int i=0;
    int max=0;
    int min=1000;
    while(i<n){
        s[i]=sc.nextInt();
        if(s[i]>max){
            max=s[i];
        }
        if(s[i]<min){
            min=s[i];
        }    
        i++;
    }
    int sum=0;
    i=0;
    int c=0;
    int c2=0;
    while(i<n){
        if(s[i]!=min && s[i]!=max){
            sum+=s[i];
        }else if(s[i]==max){
            c++;
        }else if(s[i]==min){
            c2++;
        }
        i++;
    }    
    sum+=max*(c-1);
    sum+=min*(c2-1);
    int average=0;
    average=sum/(n-2);
    SyStem.out.println(agerage);
    }
}


Compiler output:
Main.java:1: error: cannot find symbol
import java.util; 
           ^
  symbol:   class util
  location: package java
Main.java:5: error: cannot find symbol
    Scanner sc =new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
    Scanner sc =new Scanner(System.in);
                    ^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
        exit(1);
        ^
  symbol:   method exit(int)
  location: class Main
Main.java:42: error: cannot find symbol
    SyStem.out.println(agerage);
                       ^
  symbol:   variable agerage
  location: class Main
Main.java:42: error: package SyStem does not exist
    SyStem.out.println(agerage);
          ^
6 errors
Language: Java

import java.util; 
public class Main{
    public static void main(String[] args){
    int n;
    Scanner sc =new Scanner(System.in);
    n = sc.nextInt();
    if(n==0){
        exit(1);
    }
    int[] s;
    int i=0;
    int max=0;
    int min=1000;
    while(i<n){
        s[i]=sc.nextInt();
        if(s[i]>max){
            max=s[i];
        }
        else if(s[i]<min){
            min=s[i];
        }    
        i++;
    }
    int sum=0;
    i=0;
    int c=0;
    int c2=0;
    while(i<n){
        if(s[i]!=min && s[i]!=max){
            sum+=s[i];
        }else if(s[i]==max){
            c++;
        }else if(s[i]==min){
            c2++;
        }
        i++;
    }    
    sum+=max*(c-1);
    sum+=min*(c2-1);
    int average=0;
    average=sum/(n-2);
    SyStem.out.println(agerage);
    }
}


Compiler output:
Main.java:1: error: cannot find symbol
import java.util; 
           ^
  symbol:   class util
  location: package java
Main.java:5: error: cannot find symbol
    Scanner sc =new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
    Scanner sc =new Scanner(System.in);
                    ^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
        exit(1);
        ^
  symbol:   method exit(int)
  location: class Main
Main.java:42: error: cannot find symbol
    SyStem.out.println(agerage);
                       ^
  symbol:   variable agerage
  location: class Main
Main.java:42: error: package SyStem does not exist
    SyStem.out.println(agerage);
          ^
6 errors
Language: Java

import java.util.*; 
public class Main{
    public static void main(String[] args){
    int n;
    Scanner sc =new Scanner(System.in);
    n = sc.nextInt();
    if(n==0){
        exit(1);
    }
    int[] s;
    int i=0;
    int max=0;
    int min=1000;
    while(i<n){
        s[i]=sc.nextInt();
        if(s[i]>max){
            max=s[i];
        }
        else if(s[i]<min){
            min=s[i];
        }    
        i++;
    }
    int sum=0;
    i=0;
    int c=0;
    int c2=0;
    while(i<n){
        if(s[i]!=min && s[i]!=max){
            sum+=s[i];
        }else if(s[i]==max){
            c++;
        }else if(s[i]==min){
            c2++;
        }
        i++;
    }    
    sum+=max*(c-1);
    sum+=min*(c2-1);
    int average=0;
    average=sum/(n-2);
    SyStem.out.println(agerage);
    }
}


Compiler output:
Main.java:8: error: cannot find symbol
        exit(1);
        ^
  symbol:   method exit(int)
  location: class Main
Main.java:42: error: cannot find symbol
    SyStem.out.println(agerage);
                       ^
  symbol:   variable agerage
  location: class Main
Main.java:42: error: package SyStem does not exist
    SyStem.out.println(agerage);
          ^
3 errors
Language: Java

import java.util.*; 
public class Main{
    public static void main(String[] args){
    int n;
    Scanner sc =new Scanner(System.in);
    n = sc.nextInt();
    if(n==0){
        System.exit(0);
    }
    int[] s;
    int i=0;
    int max=0;
    int min=1000;
    while(i<n){
        s[i]=sc.nextInt();
        if(s[i]>max){
            max=s[i];
        }
        else if(s[i]<min){
            min=s[i];
        }    
        i++;
    }
    int sum=0;
    i=0;
    int c=0;
    int c2=0;
    while(i<n){
        if(s[i]!=min && s[i]!=max){
            sum+=s[i];
        }else if(s[i]==max){
            c++;
        }else if(s[i]==min){
            c2++;
        }
        i++;
    }    
    sum+=max*(c-1);
    sum+=min*(c2-1);
    int average=0;
    average=sum/(n-2);
    SyStem.out.println(agerage);
    }
}


Compiler output:
Main.java:42: error: cannot find symbol
    SyStem.out.println(agerage);
                       ^
  symbol:   variable agerage
  location: class Main
Main.java:42: error: package SyStem does not exist
    SyStem.out.println(agerage);
          ^
2 errors
Language: Java

import java.util.*; 
public class Main{
    public static void main(String[] args){
    while(ture){
        int n;
        Scanner sc =new Scanner(System.in);
        n = sc.nextInt();
        if(n==0){
            System.exit(0);
        }
        int[] s;
        int i=0;
        int max=0;
        int min=1000;
        while(i<n){
            s[i]=sc.nextInt();
            if(s[i]>max){
                max=s[i];
            }
            else if(s[i]<min){
                min=s[i];
            }    
            i++;
        }
        int sum=0;
        i=0;
        int c=0;
        int c2=0;
        while(i<n){
            if(s[i]!=min && s[i]!=max){
                sum+=s[i];
            }else if(s[i]==max){
                c++;
            }else if(s[i]==min){
                c2++;
            }
            i++;
        }    
        sum+=max*(c-1);
        sum+=min*(c2-1);
        int average=0;
        average=sum/(n-2);
        SyStem.out.println(average);
        }
    }
}


Compiler output:
Main.java:4: error: cannot find symbol
    while(ture){
          ^
  symbol:   variable ture
  location: class Main
Main.java:43: error: package SyStem does not exist
        SyStem.out.println(average);
              ^
2 errors
Language: Java

import java.util.*; 
public class Main{
    public static void main(String[] args){
    while(true){
        int n;
        Scanner sc =new Scanner(System.in);
        n = sc.nextInt();
        if(n==0){
            System.exit(0);
        }
        int[] s;
        int i=0;
        int max=0;
        int min=1000;
        while(i<n){
            s[i]=sc.nextInt();
            if(s[i]>max){
                max=s[i];
            }
            else if(s[i]<min){
                min=s[i];
            }    
            i++;
        }
        int sum=0;
        i=0;
        int c=0;
        int c2=0;
        while(i<n){
            if(s[i]!=min && s[i]!=max){
                sum+=s[i];
            }else if(s[i]==max){
                c++;
            }else if(s[i]==min){
                c2++;
            }
            i++;
        }    
        sum+=max*(c-1);
        sum+=min*(c2-1);
        int average=0;
        average=sum/(n-2);
        SyStem.out.println(average);
        }
    }
}


Compiler output:
Main.java:43: error: package SyStem does not exist
        SyStem.out.println(average);
              ^
1 error
Language: Java

import java.util.*; 
public class Main{
    public static void main(String[] args){
    while(true){
        int n;
        Scanner sc =new Scanner(System.in);
        n = sc.nextInt();
        System.out.println(n);
        if(n==0){
            System.exit(0);
        }
        int[] s;
        int i=0;
        int max=0;
        int min=1000;
        while(i<n){
            s[i]=sc.nextInt();
            if(s[i]>max){
                max=s[i];
            }
            else if(s[i]<min){
                min=s[i];
            }    
            i++;
        }
        int sum=0;
        i=0;
        int c=0;
        int c2=0;
        while(i<n){
            if(s[i]!=min && s[i]!=max){
                sum+=s[i];
            }else if(s[i]==max){
                c++;
            }else if(s[i]==min){
                c2++;
            }
            i++;
        }    
        sum+=max*(c-1);
        sum+=min*(c2-1);
        int average=0;
        average=sum/(n-2);
        SyStem.out.println(average);
        }
    }
}


Compiler output:
Main.java:44: error: package SyStem does not exist
        SyStem.out.println(average);
              ^
1 error
Language: Java

import java.util.*; 
public class Main{
    public static void main(String[] args){
    while(true){
        int n;
        Scanner sc =new Scanner(System.in);
        n = sc.nextInt();
        System.out.println(n);
        if(n==0){
            System.exit(0);
        }
        int[] s;
        int i=0;
        int max=0;
        int min=1000;
        while(i<n){
            s[i]=sc.nextInt();
            if(s[i]>max){
                max=s[i];
            }
            else if(s[i]<min){
                min=s[i];
            }    
            i++;
        }
        int sum=0;
        i=0;
        int c=0;
        int c2=0;
        while(i<n){
            if(s[i]!=min && s[i]!=max){
                sum+=s[i];
            }else if(s[i]==max){
                c++;
            }else if(s[i]==min){
                c2++;
            }
            i++;
        }    
        sum+=max*(c-1);
        sum+=min*(c2-1);
        int average=0;
        average=sum/(n-2);
        System.out.println(average);
        }
    }
}


Compiler output:
Main.java:17: error: variable s might not have been initialized
            s[i]=sc.nextInt();
            ^
Main.java:31: error: variable s might not have been initialized
            if(s[i]!=min && s[i]!=max){
               ^
2 errors
Language: Java

import java.util.*; 
public class Main{
    public static void main(String[] args){
        while(true){
            int n;
            Scanner sc =new Scanner(System.in);
            n = sc.nextInt();
            if(n==0){
                System.exit(0);
            }
            int[] s;
            int i=0;
            s=new int[n];
            int max=0;
            int min=999;
            while(i<n){
                s[i]=sc.nextInt();
            }
            Arrays.sort(s);
            i=1;
            while(i<n-1){
                sum+=s[i];
            }
            SyStem.out.println(sum/(n-2));
        }
    }
}


Compiler output:
Main.java:22: error: cannot find symbol
                sum+=s[i];
                ^
  symbol:   variable sum
  location: class Main
Main.java:24: error: cannot find symbol
            SyStem.out.println(sum/(n-2));
                               ^
  symbol:   variable sum
  location: class Main
Main.java:24: error: package SyStem does not exist
            SyStem.out.println(sum/(n-2));
                  ^
3 errors
Language: Java

import java.util.*; 
public class Main{
    public static void main(String[] args){
        while(true){
            int n;
            Scanner sc =new Scanner(System.in);
            n = sc.nextInt();
            if(n==0){
                System.exit(0);
            }
            int[] s;
            int i=0;
            s=new int[n];
            int max=0;
            int min=999;
            while(i<n){
                s[i]=sc.nextInt();
                i++;
            }
            Arrays.sort(s);
            i=1;
            while(i<n-1){
                sum+=s[i];
                i++;
            }
            SyStem.out.println(sum/(n-2));
        }
    }
}


Compiler output:
Main.java:23: error: cannot find symbol
                sum+=s[i];
                ^
  symbol:   variable sum
  location: class Main
Main.java:26: error: cannot find symbol
            SyStem.out.println(sum/(n-2));
                               ^
  symbol:   variable sum
  location: class Main
Main.java:26: error: package SyStem does not exist
            SyStem.out.println(sum/(n-2));
                  ^
3 errors
Language: Java

import java.util.*; 
public class Main{
    public static void main(String[] args){
        while(true){
            int n;
            Scanner sc =new Scanner(System.in);
            n = sc.nextInt();
            if(n==0){
                System.exit(0);
            }
            int[] s;
            int i=0;
            s=new int[n];
            int max=0;
            int min=999;
            while(i<n){
                s[i]=sc.nextInt();
                i++;
            }
            Arrays.sort(s);
            i=1;
            int sum=0;
            while(i<n-1){
                sum+=s[i];
                i++;
            }
            SyStem.out.println(sum/(n-2));
        }
    }
}


Compiler output:
Main.java:27: error: package SyStem does not exist
            SyStem.out.println(sum/(n-2));
                  ^
1 error
Language: Java

import java.util.Scanner; 
public class Main{
    public static void main(String[] args){
        while(true){
            int n;
            Scanner sc =new Scanner(System.in);
            n = sc.nextInt();
            if(n==0){
                System.exit(0);
            }
            int[] s;
            int i=0;
            s=new int[n];
            while(i<n){
                s[i]=sc.nextInt();
                i++;
            }
            Arrays.sort(s);
            i=1;
            int sum=0;
            while(i<n-1){
                sum+=s[i];
                i++;
            }
            System.out.println(sum/(n-2));
        }
    }
}


Compiler output:
Main.java:18: error: cannot find symbol
            Arrays.sort(s);
            ^
  symbol:   variable Arrays
  location: class Main
1 error
Language: Java

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

public class Main {

	/**
	 * @param args
	 */
	Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		new Main().run();

	}

	void run() {
		while (true) {
			int n = sc.nextInt();
			if (n == 0)
				break;
			int ss[] = new int[n];
			for (int i = 0; i < n; i++) {

				ss[i] = sc.nextInt();
			}
			Arrays.sort(ss);
			int sum = 0;
			for (int i = 1; i <= n - 2; i++) {
				sum += ss[i];
			}
			System.out.println(sum / (n - 2));
		}
	}
}
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		new Main().run();

	}

	void run() {
		while (true) {
			int n = sc.nextInt();
			if (n == 0)
				break;
			int ss[] = new int[n];
			for (int i = 0; i < n; i++) {

				ss[i] = sc.nextInt();
			}
			Arrays.sort(ss);
			int sum = 0;
			for (int i = 1; i <= n - 2; i++) {
				sum += ss[i];
			}
			System.out.println(sum / (n - 2));
		}
	}
}

Compiler output:
Main.java:37: error: class, interface, enum, or record expected
import java.util.Arrays;
^
Main.java:38: error: class, interface, enum, or record expected
import java.util.Scanner;
^
2 errors
Language: Java


import java.util.Scanner;

public class Sample {
	public static void main(String[] args) {
		int[] x = new int [256];
		int[] y = new int [256];
		Scanner stdIn = new Scanner(System.in);
		int min,max,k=0,h=0;
		while(true)
		{
			int a = stdIn.nextInt();
			if(a==0)
			{
				break;
			}
			else
			{
				for(int i=0;i<a;i++)
				{
					int b = stdIn.nextInt();
					x[i] = b;
				}
				
				min = x[0];
				max = x[0];
				h = x[0];
				
				for(int i=1;i<a;i++)
				{
					h = h + x[i];
					if(min>x[i])
						min = x[i];
					if(max<x[i])
						max = x[i];
				}
				
				y[k]=(h-min-max)/(a-2);
				
				k++;
			}
		}
		
		for(int i=0;i<k;i++)
		{
			System.out.println(y[i]);
		}
	}
}

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

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int n=0;
		int count = 0;
		while(count<20){
			n=stdIn.nextInt();
			if(n>=3&&n<=100) break;
			count++;
		}
		int[] s=new int[n];
		for(int i=0;i<s.length;i++){
			while(count<20){
				s[i]=stdIn.nextInt();
				if(s[i]>=0&&s[i]<=1000) break;
				count++;
			}

		}

		int max = s[0];
		int min = s[0];
		int a=0;
		int b=0;
		for(int i=1;i<s.length;i++){
			if(s[i]>max){
				max = s[i];
				a=i;
			}
			if(s[i]<min){
				min = s[i];
				b=i;
			}
		}
		s[a]=0;
		s[b]=0;
		int all = 0;
		for(int i=0;i<s.length;i++){
			all += s[i];
		}
		int ave = all/(n-2);

		System.out.println(0);
		System.out.println(ave);
	}

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

import java.util.Scanner;

public class HelloWorld{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int n=0;
		int count = 0;
		while(count<20){
			n=stdIn.nextInt();
			if(n>=3&&n<=100) break;
			count++;
		}
		int[] s=new int[n];
		for(int i=0;i<s.length;i++){
			while(count<20){
				s[i]=stdIn.nextInt();
				if(s[i]>=0&&s[i]<=1000) break;
				count++;
			}

		}

		int max = s[0];
		int min = s[0];
		int a=0;
		int b=0;
		for(int i=1;i<s.length;i++){
			if(s[i]>max){
				max = s[i];
				a=i;
			}
			if(s[i]<min){
				min = s[i];
				b=i;
			}
		}
		s[a]=0;
		s[b]=0;
		int all = 0;
		for(int i=0;i<s.length;i++){
			all += s[i];
		}
		int ave = all/(n-2);

		System.out.println(0);
		System.out.println(ave);
	}

}

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: Java

public class Main{

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

	}

}

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

import java.io.*;
public class Main{
	public static void main(String[] args){
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line;
		int i;
		int n;
		//int[] scores;
		int max;
		int min;
		int ave;
		int score;
		try{
			while(null != (line=reader.readLine())){
				n = Integer.parseInt(line);
				if(n==0)return;
				ave = 0;
				min = 0;
				max = 0;
				scores = new int[n];
				for(i=0; i<n; i++){
					line = reader.readLine();
					score = Integer.parseInt(line);
					//scores[i] = score;
//					ave += score;
					/*if(max < 0){
						max = score;
					}else */
					if(max < score){
						ave += max;
						max = score;
						min = 0;
					}else{
						if(min <= 0){
							min = score;
						}else if(min > score){
							ave += min;
							min = score;
						}else{
							ave += score;
						}
					}
					
				}
				ave = ave/(n-2);
				System.out.println(">"+ave);
			}
		}catch(IOException e){
			System.out.println(e);
		}
		
	}
}

Compiler output:
Main.java:20: error: cannot find symbol
				scores = new int[n];
				^
  symbol:   variable scores
  location: class Main
1 error
Language: Java


import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {
		int n, w, sum = 0;
		int min = 10000;
		int max = -100;
		Scanner sc = new Scanner(System.in);
		w = sc.nextInt();
		for (int i = 0; i < w; i++) {
			n = sc.nextInt();
			sum += n;
			if (n > max)
				max = n;
			else if (n < min)
				min = n;

		}
		System.out.println((sum-(max+min))/(w-2));
	}

}

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

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

}

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

import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] sum = new int[10000];
		int small=0;
		int max=0;
		int wa= 0;

		for(int i=0;i<=n-1;i++){
			
			int k = sc.nextInt();
			sum[i] = k;
			wa = wa + sum[i];
			if(i == 1){
				if(sum[0]>=sum[1]){
					max = sum[0];
					small = sum[1];
				}
				else{
					max = sum[1];
					small = sum[0];
				}
			}
			
			if(i>=2){
				if(max<=sum[i]){
					max = sum[i];
				}
				if(small>=sum[i]){
					small = sum[i];
				}
			}


		}
		double ave;
		ave = (wa-small-max)/(n-2);

		System.out.println(Math.floor(ave);
	}


		
}

Compiler output:
Main.java:41: error: ')' or ',' expected
		System.out.println(Math.floor(ave);
		                                  ^
1 error
Language: Java

iimport java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] sum = new int[10000];
		int small=0;
		int max=0;
		int wa= 0;

		for(int i=0;i<=n-1;i++){
			
			int k = sc.nextInt();
			sum[i] = k;
			wa = wa + sum[i];
			if(i == 1){
				if(sum[0]>=sum[1]){
					max = sum[0];
					small = sum[1];
				}
				else{
					max = sum[1];
					small = sum[0];
				}
			}
			
			if(i>=2){
				if(max<=sum[i]){
					max = sum[i];
				}
				if(small>=sum[i]){
					small = sum[i];
				}
			}


		}
		double ave;
		ave = (wa-small-max)/(n-2);

		System.out.println(Math.floor(ave));
	}


		
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
iimport java.util.Scanner;
^
1 error
Language: Java

package ICPC_Score_Totalizer_Software;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Judge {
	static int number;		//?????£??????????????°
	int score;				//??????

	public static void setNumberOfJudge() {			//?????£??????????????°?????????
		try{
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			number = Integer.parseInt(in.readLine());

		}
		catch(Exception e){
			System.out.println("???????????????????????????"+e);
		}
	}

	public void setScore(){			//???????????????
		try{
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			score = Integer.parseInt(in.readLine());

		}
		catch(Exception e){
			System.out.println("???????????????????????????"+e);
		}
	}

}

public class Exec {

	public static void main(String[] args) {
		while(true){
			Judge.setNumberOfJudge();					//?????£??????????????°?????????
			if(Judge.number == 0){System.exit(0);}		//?????£?????????0????????????????????°???????????????
			Judge j[] = new Judge[Judge.number];		//?????£??????????????°????????????????????????

			int i;
			for(i=0;i<Judge.number;i++){
				j[i]= new Judge();						//??????????????????????????????????´???????
				j[i].setScore();						//???????????????
			}

			int max = 0;								//??????????????§????????????
			int maxJ = 0;								//?????§???????????????????????£????????????????????????
			int min = 1001;
			int minJ = 0;
			for(i=0;i<Judge.number;i++){
				if(max < j[i].score){					//?????§?????????????????£??????????±???????
					max = j[i].score;
					maxJ = i;
				}
				if(j[i].score < min){					//????°??????????????????£??????????±???????
					min = j[i].score;
					minJ = i;
				}
			}

			int sum = 0;							//?????§?????¨????°?????????????????????????????¨?
			int k;
			for(k=0;k < Judge.number;k++){
				if(k != maxJ && k != minJ){			//?????§?????§???????°??????§???????????¨???
					sum += j[k].score;
				}
			}
				System.out.println(sum);
		}
	}

}

Compiler output:
Main.java:6: error: class Judge is public, should be declared in a file named Judge.java
public class Judge {
       ^
Main.java:34: error: class Exec is public, should be declared in a file named Exec.java
public class Exec {
       ^
2 errors
Language: Java

package ICPC_Score_Totalizer_Software;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Judge {
	static int number;		//?????£??????????????°
	int score;				//??????

	public static void setNumberOfJudge() {			//?????£??????????????°?????????
		try{
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			number = Integer.parseInt(in.readLine());

		}
		catch(Exception e){
			System.out.println("???????????????????????????"+e);
		}
	}

	public void setScore(){			//???????????????
		try{
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			score = Integer.parseInt(in.readLine());

		}
		catch(Exception e){
			System.out.println("???????????????????????????"+e);
		}
	}



	public static void main(String[] args) {
		while(true){
			Judge.setNumberOfJudge();					//?????£??????????????°?????????
			if(Judge.number == 0){System.exit(0);}		//?????£?????????0????????????????????°???????????????
			Judge j[] = new Judge[Judge.number];		//?????£??????????????°????????????????????????

			int i;
			for(i=0;i<Judge.number;i++){
				j[i]= new Judge();						//??????????????????????????????????´???????
				j[i].setScore();						//???????????????
			}

			int max = 0;								//??????????????§????????????
			int maxJ = 0;								//?????§???????????????????????£????????????????????????
			int min = 1001;
			int minJ = 0;
			for(i=0;i<Judge.number;i++){
				if(max < j[i].score){					//?????§?????????????????£??????????±???????
					max = j[i].score;
					maxJ = i;
				}
				if(j[i].score < min){					//????°??????????????????£??????????±???????
					min = j[i].score;
					minJ = i;
				}
			}

			int sum = 0;							//?????§?????¨????°?????????????????????????????¨?
			int k;
			for(k=0;k < Judge.number;k++){
				if(k != maxJ && k != minJ){			//?????§?????§???????°??????§???????????¨???
					sum += j[k].score;
				}
			}
				System.out.println(sum);
	}

	}
}

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

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Judge {
	static int number;		//?????£??????????????°
	int score;				//??????

	public static void setNumberOfJudge() {			//?????£??????????????°?????????
		try{
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			number = Integer.parseInt(in.readLine());

		}
		catch(Exception e){
			System.out.println("???????????????????????????"+e);
		}
	}

	public void setScore(){			//???????????????
		try{
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			score = Integer.parseInt(in.readLine());

		}
		catch(Exception e){
			System.out.println("???????????????????????????"+e);
		}
	}



	public static void main(String[] args) {
		while(true){
			Judge.setNumberOfJudge();					//?????£??????????????°?????????
			if(Judge.number == 0){System.exit(0);}		//?????£?????????0????????????????????°???????????????
			Judge j[] = new Judge[Judge.number];		//?????£??????????????°????????????????????????

			int i;
			for(i=0;i<Judge.number;i++){
				j[i]= new Judge();						//??????????????????????????????????´???????
				j[i].setScore();						//???????????????
			}

			int max = 0;								//??????????????§????????????
			int maxJ = 0;								//?????§???????????????????????£????????????????????????
			int min = 1001;
			int minJ = 0;
			for(i=0;i<Judge.number;i++){
				if(max < j[i].score){					//?????§?????????????????£??????????±???????
					max = j[i].score;
					maxJ = i;
				}
				if(j[i].score < min){					//????°??????????????????£??????????±???????
					min = j[i].score;
					minJ = i;
				}
			}

			int sum = 0;							//?????§?????¨????°?????????????????????????????¨?
			int k;
			for(k=0;k < Judge.number;k++){
				if(k != maxJ && k != minJ){			//?????§?????§???????°??????§???????????¨???
					sum += j[k].score;javascript:void(0)
				}
			}
				System.out.println(sum);
	}

	}
}

Compiler output:
Main.java:63: error: illegal start of expression
					sum += j[k].score;javascript:void(0)
					                             ^
Main.java:63: error: ';' expected
					sum += j[k].score;javascript:void(0)
					                                 ^
2 errors
Language: Java

import java.io.*;

public class Exec {

	public static void main(String[] args) {
		while(true){
			try{
				BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
				int number = Integer.parseInt(reader.readLine());
				if(number == 0){System.exit(0);}
				int score[];
				score = new int[number];
				int i;
				for(i=0;i<number;i++){
					score[i] = Integer.parseInt(reader.readLine());
				}
				
				int max = 0;
				int maxJ = 0;
				int min = 1001;
				int minJ = 0;
				
				for(i=0;i<number;i++){
					if(max <= score[i]){
						max = score[i];
						maxJ = i;
					}
					if(score[i] <= min && i != maxJ){
						min = score[i];
						minJ = i;
					}
				}
				
				int sum = 0;
				for(i=0;i<number;i++){
					if(i != minJ && i != maxJ){
						sum += score[i];
					}
				}
				System.out.println(sum/(number-2));
			}
			catch(IOException e){
				System.out.println(e);
			}
		}
	}
}

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

public class Main {

	public static void main(String[] args) {
		while(true){
			try{
				BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
				int number = Integer.parseInt(reader.readLine());
				if(number < 3){return;}
				int score[];
				score = new int[number];
				int i;
				for(i=0;i<number;i++){
					score[i] = Integer.parseInt(reader.readLine());
				}
				
				int max = 0;
				int maxJ = 0;
				int min = 1001;
				int minJ = 0;
				
				for(i=0;i<number;i++){
					if(max <= score[i]){
						max = score[i];
						maxJ = i;
					}
					if(score[i] <= min && i != maxJ){
						min = score[i];
						minJ = i;
					}
				}
				
				int sum = 0;
				for(i=0;i<number;i++){
					if(i != minJ && i != maxJ){
						sum += score[i];
					}
				}
				System.out.println(sum/(number-2));
			}
			catch(IOException e){
				System.out.println(e);
			}
		}
	}
}

Compiler output:
Main.java:6: error: cannot find symbol
				BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
				^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
				BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
				                            ^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
				BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
				                                               ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:40: error: cannot find symbol
			catch(IOException e){
			      ^
  symbol:   class IOException
  location: class Main
4 errors
Language: Java

package AOJ1147;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		while(true){
			try{
				BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
				int number = Integer.parseInt(reader.readLine());
				if(number < 3){break;}
				int score[];
				score = new int[number];
				int i;
				for(i=0;i<number;i++){
					score[i] = Integer.parseInt(reader.readLine());
				}
				
				int max = 0;
				int maxJ = 0;
				int min = 1001;
				int minJ = 0;
				
				for(i=0;i<number;i++){
					if(max <= score[i]){
						max = score[i];
						maxJ = i;
					}
					if(score[i] <= min && i != maxJ){
						min = score[i];
						minJ = i;
					}
				}
				
				int sum = 0;
				for(i=0;i<number;i++){
					if(i != minJ && i != maxJ){
						sum += score[i];
					}
				}
				System.out.println(sum/(number-2));
			}
			catch(IOException e){
				System.out.println(e);
			}
		}
		return 0;
	}
}

Compiler output:
Main.java:47: error: incompatible types: unexpected return value
		return 0;
		       ^
1 error
Language: Java

package lesson1;

import java.util.Scanner;

public class Class {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while (true) {
			int judge = sc.nextInt();
			if (judge == 0)
				break;

			int[] score = new int[judge];
			int max = 0, min = 1000, sum = 0;

			for (int i = 0; i < judge; i++) {
				score[i] = sc.nextInt();
				sum += score[i];
				if (score[i] > max)
					max = score[i];
				if (score[i] < min)
					min = score[i];
			}

			System.out.println((int) Math.floor((double) (sum - max - min)
					/ (double) (judge - 2)));
		}
	}
}

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

import java.util.Scanner;

public class Class {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while (true) {
			int judge = sc.nextInt();
			if (judge == 0)
				break;

			int[] score = new int[judge];
			int max = 0, min = 1000, sum = 0;

			for (int i = 0; i < judge; i++) {
				score[i] = sc.nextInt();
				sum += score[i];
				if (score[i] > max)
					max = score[i];
				if (score[i] < min)
					min = score[i];
			}

			System.out.println((int) Math.floor((double) (sum - max - min)
					/ (double) (judge - 2)));
		}
	}
}

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

import java.util.Scanner;

public class Class {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while (true) {
			int judge = sc.nextInt();
			if (judge == 0)
				break;

			int[] score = new int[judge];
			int max = 0, min = 1000, sum = 0;

			for (int i = 0; i < judge; i++) {
				score[i] = sc.nextInt();
				sum += score[i];
				if (score[i] > max)
					max = score[i];
				if (score[i] < min)
					min = score[i];
			}

			System.out.println((sum - max - min) / (judge - 2));
		}
	}
}

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

import java.util.Scanner;

public class MAIN {
	public static void main(String[] args) {
		// !!initialize!!
		Scanner sc = new Scanner(System.in);
		// !!initialize!!

		for (int count = 0; -1 < count; count++) {
			// ??????????????°?????\??????
			// val:??\??????????????°?????????
			int val = sc.nextInt();

			// ????????????0????????´???break??????
			if (val == 0) {
				break;
			}
			// ????????????????????´??????????????????
			fig_ave(val);
		}
	}

	// ?????§?????\????????????????????§/????°??????????????????????????±???????
	public static void fig_ave(int val) {

		// !!initialize!!
		int[] score = new int[val];
		int sum = 0;
		int max = 0; // ?????§???
		int min = 1001; // ????°????
		Scanner sc = new Scanner(System.in);
		// !!initialize!!

		for (int i = 0; i < val; i++) {
			score[i] = sc.nextInt();

			// ??\???????????????????????§???????±??????????
			if (max < score[i]) {
				max = score[i];
			}
			// ??\??????????????????????°????????±??????????
			if (min > score[i]) {
				min = score[i];
			}
		}

		// ??????????±???????
		for (int j = 0; j < val; j++) {
			// ??????????±??????????
			sum = sum + score[j];
		}

		// max,min??????????????????????±??????????
		sum = (sum - max - min) / (val - 2);
		System.out.println(sum);

	}
}

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

import java.io.*;
import java.util.*;
 
public class main {
	static InputStreamReader isr;
	static BufferedReader br;
	public static void main(String args[]) throws IOException{
	    isr = new InputStreamReader(System.in);
		br = new BufferedReader(isr);
		int c;
		while ((c = getint() ) != -1){
		    if (c != 0){
                int[] arr = getData(c);
                Arrays.sort(arr);
                System.out.println( averageP(arr) );
		    }else{
                System.out.println("");
                break;
            }
        }
	}
	static int getint(){
	    try{
	        int n = 0;
			String buf = br.readLine();
			n = Integer.parseInt(buf);
			return n;
		}catch(Exception e){
		    return -1;
		}
	}
	static int[] getData(int n){
	    try{
    	    int[] r = new int[n];
    	    for(int i=0; i<n; i++){
    	        r[i] = Integer.parseInt(br.readLine());
    	    }
    	    return r;
	    }catch(Exception e){
	        System.err.println("List Length Error");
	        return new int[]{};
	    }
	}
	static int averageP(int[] r){
	    if(r.length > 2){
	        int sum = 0;
	        for(int i=1; i<(r.length-1); i++){
	            sum += r[i];
	        }
	        sum = sum / (r.length - 2);
	        return sum;
	    }else{
	        return 0;
	    }
	}
}

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


import java.util.Scanner;

public class main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		System.out.println("");
		while(sc.hasNextLine()){
			int n = sc.nextInt();
			int[] score = new int[n];
			for(int i=0; i<n; i++){ score[i] = sc.nextInt(); }

			int max = score[0];
			int min = score[0];
			for(int i=0; i<n; i++){
				if(max <= score[i]){ max = score[i]; }
				if(min >= score[i]){ min = score[i]; }
			}

			int average = 0;
			for(int i=0; i<n; i++){ average += score[i]; }
			average = (average - max - min) / (n - 2);
			System.out.println(average);
		}
	}
}

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

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

Compiler output:
Main.java:2: error: class, interface, enum, or record expected
??
^
1 error
Language: Java

package at_coder;
import java.util.*;
public class main {
		private static Scanner sc;
		public static void main(String[] args){
			sc = new Scanner(System.in);
			List<Integer> list = new ArrayList<Integer>();
			int a;
			int i=0;
			int judge;
			while ((judge=sc.nextInt())>0){
				for (int j=1; j<judge+1; j++){
					list.add(a = sc.nextInt());
					i++;
				}
				Collections.sort(list);
				Collections.reverse(list);
				int sum = 0;
				for (int k=1; k<i-1; k++){
					sum = sum+list.get(k);
				}
				System.out.println((sum/(i-2)));
				i=0;
				list.clear();
			}
			
		}
}

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