Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
??
public class Main {
????????public static void main(String[] args) {
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
????????????????int field = 0;
????????????????long scoreCount = 0;
????????????????int outCount = 0;
????????????????int finishedGame = 0;
????????????????String line = "";
????????????????try {
????????????????????????int gameNumber = br.read();
????????????????????????while (finishedGame != gameNumber) {
????????????????????????????????line = br.readLine();
????????????????????????????????switch (line) {
????????????????????????????????case "HIT":
????????????????????????????????????????if(field==3) {
????????????????????????????????????????????????scoreCount++;
????????????????????????????????????????????????field--;
????????????????????????????????????????}
????????????????????????????????????????field++;
????????????????????????????????????????break;
????????????????????????????????case "OUT":
????????????????????????????????????????outCount++;
????????????????????????????????????????if (outCount == 3) {
????????????????????????????????????????????????System.out.println(scoreCount);
????????????????????????????????????????????????scoreCount = 0;
????????????????????????????????????????????????outCount = 0;
????????????????????????????????????????????????field = 0;
????????????????????????????????????????????????finishedGame++;
????????????????????????????????????????}
????????????????????????????????????????break;
????????????????????????????????case "HOMERUN":
????????????????????????????????????????scoreCount += 1 + field;
????????????????????????????????????????field = 0;
????????????????????????????????????????break;
????????????????????????????????}
????????????????????????}
????????????????????????br.close();
????????????????} catch (IOException e) {
????????????????????????e.printStackTrace();
????????????????}
????????}
}

Compiler output:
Main.java:4: error: class, interface, enum, or record expected
??
^
Main.java:6: error: illegal start of type
????????public static void main(String[] args) {
^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
   ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
     ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
           ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
             ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
              ^
Main.java:7: error: illegal start of expression
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
               ^
Main.java:7: error: : expected
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                              ^
Main.java:7: error: : expected
????????????????BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                                                                        ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
 ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
  ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
   ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
    ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
     ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
      ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
       ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
        ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
         ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
          ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
           ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
            ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
             ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
              ^
Main.java:8: error: illegal start of expression
????????????????int field = 0;
               ^
Main.java:8: error: '.class' expected
????????????????int field = 0;
                    ^
Main.java:8: error: : expected
????????????????int field = 0;
                             ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
 ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
  ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
   ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
    ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
     ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
      ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
       ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
        ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
         ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
          ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
           ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
            ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
             ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
              ^
Main.java:9: error: illegal start of expression
????????????????long scoreCount = 0;
               ^
Main.java:9: error: '.class' expected
????????????????long scoreCount = 0;
                     ^
Main.java:9: error: : expected
????????????????long scoreCount = 0;
                                   ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
 ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
  ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
   ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
    ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
     ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
      ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
       ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
        ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
         ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
          ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
           ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
            ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
             ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
              ^
Main.java:10: error: illegal start of expression
????????????????int outCount = 0;
               ^
Main.java:10: error: '.class' expected
????????????????int outCount = 0;
                    ^
Main.java:10: error: : expected
????????????????int outCount = 0;
                                ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
 ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
  ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
   ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
    ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
     ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
      ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
       ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
        ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
         ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
          ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
           ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
            ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
             ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
              ^
Main.java:11: error: illegal start of expression
????????????????int finishedGame = 0;
               ^
Main.java:11: error: '.class' expected
????????????????int finishedGame = 0;
                    ^
Main.java:11: error: : expected
????????????????int finishedGame = 0;
                                    ^
Main.java:12: error: illegal start of expression
????????????????String line = "";
^
Main.java:12: error: illegal start of expression
????????????????String line = "";
 ^
Main.java:12: error: illegal start of expression
????????????????String line = "";
  ^
Main.java:12: error: illegal start of expression
????????????????String line = "";
   ^
Main.java:12: error: illegal start of expression
????????????????String line = "";
    ^
Main.java:12: error: illegal start of expression
????????????????String line = "";
     ^
Main.java:12: error: illegal start of expression
????????????????String line = "";
      ^