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: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: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;
           ^
Main.java:9: error: illegal start of expression
????????????   break;
               ^
Main.java:10: error: illegal start of expression
????????????}
^
Main.java:10: error: illegal start of expression
????????????}
 ^
Main.java:10: error: illegal start of expression
????????????}
  ^
Main.java:10: error: illegal start of expression
????????????}
   ^
Main.java:10: error: illegal start of expression
????????????}
    ^
Main.java:10: error: illegal start of expression
????????????}
     ^
Main.java:10: error: illegal start of expression
????????????}
      ^
Main.java:10: error: illegal start of expression
????????????}
       ^
Main.java:10: error: illegal start of expression
????????????}
        ^
Main.java:10: error: illegal start of expression
????????????}
         ^
Main.java:10: error: illegal start of expression
????????????}
          ^
Main.java:10: error: illegal start of expression
????????????}
           ^
Main.java:10: error: illegal start of expression
????????????}
            ^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
 ^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
  ^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
   ^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
    ^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
     ^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
      ^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
       ^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
        ^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
         ^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
          ^
Main.java:11: error: illegal start of expression
????????????int[] values = new int[n];
           ^
Main.java:11: error: '.class' expected
????????????int[] values = new int[n];
                  ^
Main.java:11: error: : expected
????????????int[] values = new int[n];
                                     ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
 ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
  ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
   ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
    ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
     ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
      ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
       ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
        ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
         ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
          ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
           ^
Main.java:12: error: illegal start of expression
????????????for (int i = 0; i < n; i++) {
            ^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
 ^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
  ^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
   ^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
    ^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
     ^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
      ^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
       ^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
        ^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
         ^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
          ^
Main.java:13: error: illegal start of expression
????????????   values[i] = sc.nextInt();
           ^
Main.java:13: error: : expected
????????????   values[i] = sc.nextInt();
                                       ^
Main.java:14: error: illegal start of expression
????????????}
^
Main.java:14: error: illegal start of expression
????????????}
 ^
Main.java:14: error: illegal start of expression
????????????}
  ^
Main.java:14: error: illegal start of expression
????????????}
   ^
Main.java:14: error: illegal start of expression
????????????}
    ^
Main.java:14: error: illegal start of expression
????????????}
     ^
Main.java:14: error: illegal start of expression
????????????}
      ^
Main.java:14: error: illegal start of expression
????????????}
       ^
Main.java:14: error: illegal start of expression
????????????}
        ^
Main.java:14: error: illegal start of expression
????????????}
         ^
Main.java:14: error: illegal start of expression
????????????}
          ^
Main.java:14: error: illegal start of expression
????????????}
           ^
100 errors
only showing the first 100 errors, of 237 total; use -Xmaxerrs if you would like to see more
printing javac parameters to: /w/javac.20260128_025226.args