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
??
^
Main.java:4: error: illegal start of type
????????public static void main(String[] args) {
^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
 ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
  ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
   ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
    ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
     ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
      ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
       ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
        ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
         ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
          ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
           ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
            ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
             ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
              ^
Main.java:5: error: illegal start of expression
????????????????Scanner sc = new Scanner(System.in);
               ^
Main.java:5: error: : expected
????????????????Scanner sc = new Scanner(System.in);
                       ^
Main.java:5: error: : expected
????????????????Scanner sc = new Scanner(System.in);
                                                   ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
^
Main.java:6: error: illegal start of expression
????????????????while (true) {
 ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
  ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
   ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
    ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
     ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
      ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
       ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
        ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
         ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
          ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
           ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
            ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
             ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
              ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
               ^
Main.java:6: error: illegal start of expression
????????????????while (true) {
                ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
 ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
  ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
   ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
    ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
     ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
      ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
       ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
        ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
         ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
          ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
           ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
            ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
             ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
              ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
               ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
                ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
                 ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
                  ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
                   ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
                    ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
                     ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
                      ^
Main.java:7: error: illegal start of expression
????????????????????????int n = sc.nextInt();
                       ^
Main.java:7: error: '.class' expected
????????????????????????int n = sc.nextInt();
                            ^
Main.java:7: error: : expected
????????????????????????int n = sc.nextInt();
                                            ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
 ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
  ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
   ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
    ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
     ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
      ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
       ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
        ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
         ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
          ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
           ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
            ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
             ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
              ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
               ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
                ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
                 ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
                  ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
                   ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
                    ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
                     ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
                      ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
                       ^
Main.java:8: error: illegal start of expression
????????????????????????if (n == 0) {
                        ^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
 ^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
  ^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
   ^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
    ^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
     ^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
      ^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
       ^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
        ^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
         ^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
          ^
Main.java:9: error: illegal start of expression
????????????????????????????????break;
           ^
100 errors
only showing the first 100 errors, of 121 total; use -Xmaxerrs if you would like to see mor