criyle/codenet-compile-errors huggingface dataset:
Language: Java

#include <iostream>

int main(int argc, const char * argv[]) {
    int k;
    int out = 0;
    int hit = 0;
    int numrun = 0;
    int pointa = 0;
    int pointb = 0;
    int ining = 0;
    
    std::cin >> ining;
    int i = 1;
    while(i < ining + 1){
        std::string judge;
        std::cin >> judge;
        
        if(judge == "HIT"){
            hit++;
            if(hit == 4){
                pointa++;
                hit = hit - 1;
            }
        }
        
        if(judge == "OUT"){
            out++;
            if(out >= 3){
                i++;
                std::cout << pointa << std::endl;
                hit = 0;
                out = 0;
                pointa = 0;
            }
        }
        
        if(judge == "HOMERUN"){
            pointa = pointa + hit + 1;
            hit = 0;
        }
  }
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
#include <iostream>
         ^
  (use --enable-preview to enable unnamed classes)
Main.java:3: error: illegal start of type
int main(int argc, const char * argv[]) {
                   ^
Main.java:3: error: class, interface, enum, or record expected
int main(int argc, const char * argv[]) {
                         ^
Main.java:12: error: class, interface, enum, or record expected
    std::cin >> ining;
    ^
Main.java:14: error: class, interface, enum, or record expected
    while(i < ining + 1){
    ^
Main.java:16: error: class, interface, enum, or record expected
        std::cin >> judge;
        ^
Main.java:18: error: class, interface, enum, or record expected
        if(judge == "HIT"){
        ^
Main.java:20: error: class, interface, enum, or record expected
            if(hit == 4){
            ^
Main.java:22: error: class, interface, enum, or record expected
                hit = hit - 1;
                ^
Main.java:23: error: class, interface, enum, or record expected
            }
            ^
Main.java:28: error: class, interface, enum, or record expected
            if(out >= 3){
            ^
Main.java:30: error: class, interface, enum, or record expected
                std::cout << pointa << std::endl;
                ^
Main.java:31: error: class, interface, enum, or record expected
                hit = 0;
                ^
Main.java:32: error: class, interface, enum, or record expected
                out = 0;
                ^
Main.java:33: error: class, interface, enum, or record expected
                pointa = 0;
                ^
Main.java:34: error: class, interface, enum, or record expected
            }
            ^
Main.java:39: error: class, interface, enum, or record expected
            hit = 0;
            ^
Main.java:40: error: class, interface, enum, or record expected
        }
        ^
19 errors
Language: Java

import java.util.Scanner;

public class Main {
	private byte[] runner;
	private static final int OUT_COUNT_FOR_CHANGE = 3;
	enum EVENT {HIT, HOMERUN, OUT};
	
	private byte out;
	private int scoreOfInning;
	
	public Main {
		this.runner = new byte[3];
		this.out = 0;
		this.scoreOfInning = 0;
	}
	
	public boolean action(EVENT e) {
		boolean isChange = false;
		
		switch(e) {
		case HIT:
			scoreOfInning += hit();
			break;
		case HOMERUN:
			scoreOfInning += homerun();
			break;
		case OUT:
			isChange = out();
			break;
		default:
			break;
		}
		return isChange;
	}
	
	private int hit() {
		int ret = runner[2]==1 ? 1 : 0;
		
		runner[2] = runner[1];
		runner[1] = runner[0];
		runner[0] = 1;
		
		return ret;
	}
	
	private boolean out() {
		out++;
		if(out==OUT_COUNT_FOR_CHANGE) {
			System.out.println(scoreOfInning);
			out = 0;
			scoreOfInning = 0;
			clearRunner();
			return true;
		}
		return false;
	}
	
	private int homerun() {
		int ret = runner[0] + runner[1] + runner[2] + 1;
		
		clearRunner();
		return ret;
	}
	
	private void clearRunner() {
		runner[0] = runner[1] = runner[2] = 0;
	}
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		Main sim = new Main();
		
		int numOfDataSet = in.nextInt();
		EVENT e = EVENT.HIT;
		for(int i=0; i<numOfDataSet; i++) {
			do {
				String event = in.next();
				
				if(event.equals("HIT")) e = EVENT.HIT;
				else if(event.equals("HOMERUN")) e = EVENT.HOMERUN;
				else if(event.equals("OUT")) e = EVENT.OUT;
				else System.exit(1);
				
			} while(!sim.action(e));
		}
	}

}

Compiler output:
Main.java:11: error: <identifier> expected
	public Main {
	           ^
1 error
Language: Java

import java.io.*;

public class Main{
  public static void main(String[] args){
    Scanner s = new Scanner(System.in);
    int count_out = 0, inning;
    int baseflag = 0;
    String str = "";
    String binary = "";

    inning = s.nextInt();

    int[] score = new int[inning];

    while(count_out < inning * 3){

      try{
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        str = bf.readLine();
      }catch(Exception e){
        System.out.println(e);
      }

      if(str.equals("OUT")){
        count_out++;
      }else if(str.equals("HIT")){
        baseflag = baseflag << 1;
        baseflag++;

/*        binary = Integer.toBinaryString(baseflag);
        System.out.println(binary);   */

        if(baseflag > 8){
          baseflag -= 8;
          score[count_out/3]++;

/*          binary = Integer.toBinaryString(baseflag);
          System.out.println(binary);   */

        }
      }else if(str.equals("HOMERUN")){
        if(baseflag == 1 || baseflag == 2 || baseflag == 4){
          score[count_out/3] += 2;
        }else if(baseflag == 3 || baseflag == 5 || baseflag == 6){
          score[count_out/3] += 3;
        }else if(baseflag == 0){
          score[count_out/3]++;
        }else{
          score[count_out/3] += 4;
        }
        baseflag = 0;

/*        binary = Integer.toBinaryString(baseflag);
        System.out.println(binary);   */

      }
    }

    for(int i = 0;i < inning;i++){
      System.out.println(score[i]);
    }
  }

/*  public static String read(){
    try{
      BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
      String s = bf.readLine();
    }catch(Exception e){
      System.out.println(e);
    }

    return s;
  }
*/
}

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

import java.io.*;

public class BaseballSimulation{
  public static void main(String[] args){
    Scanner s = new Scanner(System.in);
    int count_out = 0, inning;
    int baseflag = 0;
    String str = "";
    String binary = "";

    inning = s.nextInt();

    int[] score = new int[inning];

    while(count_out < inning * 3){

      try{
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        str = bf.readLine();
      }catch(Exception e){
        System.out.println(e);
      }

      if(str.equals("OUT")){
        count_out++;
      }else if(str.equals("HIT")){
        baseflag = baseflag << 1;
        baseflag++;

        if(baseflag > 8){
          baseflag -= 8;
          score[count_out/3]++;
        }
      }else if(str.equals("HOMERUN")){
        if(baseflag == 1 || baseflag == 2 || baseflag == 4){
          score[count_out/3] += 2;
        }else if(baseflag == 3 || baseflag == 5 || baseflag == 6){
          score[count_out/3] += 3;
        }else if(baseflag == 0){
          score[count_out/3]++;
        }else{
          score[count_out/3] += 4;
        }
        baseflag = 0;
      }
    }

    for(int i = 0;i < inning;i++){
      System.out.println(score[i]);
    }
  }
}

Compiler output:
Main.java:3: error: class BaseballSimulation is public, should be declared in a file named BaseballSimulation.java
public class BaseballSimulation{
       ^
Main.java:5: error: cannot find symbol
    Scanner s = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class BaseballSimulation
Main.java:5: error: cannot find symbol
    Scanner s = new Scanner(System.in);
                    ^
  symbol:   class Scanner
  location: class BaseballSimulation
3 errors
Language: Java

import java.util.Scanner;

public class BaseballSimulation{
  public static void main(String[] args){
    Scanner s = new Scanner(System.in);
    int count_out = 0, inning;
    int baseflag = 0;
    String str = "";
    String binary = "";

    inning = s.nextInt();

    int[] score = new int[inning];

    while(count_out < inning * 3){

      try{
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        str = bf.readLine();
      }catch(Exception e){
        System.out.println(e);
      }

      if(str.equals("OUT")){
        count_out++;
      }else if(str.equals("HIT")){
        baseflag = baseflag << 1;
        baseflag++;

        if(baseflag > 8){
          baseflag -= 8;
          score[count_out/3]++;
        }
      }else if(str.equals("HOMERUN")){
        if(baseflag == 1 || baseflag == 2 || baseflag == 4){
          score[count_out/3] += 2;
        }else if(baseflag == 3 || baseflag == 5 || baseflag == 6){
          score[count_out/3] += 3;
        }else if(baseflag == 0){
          score[count_out/3]++;
        }else{
          score[count_out/3] += 4;
        }
        baseflag = 0;
      }
    }

    for(int i = 0;i < inning;i++){
      System.out.println(score[i]);
    }
  }
}

Compiler output:
Main.java:3: error: class BaseballSimulation is public, should be declared in a file named BaseballSimulation.java
public class BaseballSimulation{
       ^
Main.java:18: error: cannot find symbol
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        ^
  symbol:   class BufferedReader
  location: class BaseballSimulation
Main.java:18: error: cannot find symbol
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
                                ^
  symbol:   class BufferedReader
  location: class BaseballSimulation
Main.java:18: error: cannot find symbol
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
                                                   ^
  symbol:   class InputStreamReader
  location: class BaseballSimulation
4 errors
Language: Java

import java.util.Scanner;
public class KmcProcon1 {

    private static int[] base = {0, 0, 0};
    private static int out = 0;
    private static int score = 0;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String input = scan.next();
        int i = 0;
        String[] arr = input.split("\n");
        int dataset = Integer.parseInt(arr[0]);
        i++;
        for (int j = 0; j < dataset;  j++) {
            boolean game = true;
            score =0;
            while (game) {
                switch (arr[i]) {
                    case "HIT":
                        if (base[2] == 1) {
                            score++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            base[2] = 1;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            base[1] = 1;
                            base[0] = 0;
                        }
                        base[0] = 1;
                        break;
                    case "HOMERUN":
                        int runner = 1;
                        if (base[2] == 1) {
                            runner++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            runner++;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            runner++;
                            base[0] = 0;
                        }
                        score += runner;
                        break;
                    case "OUT":
                        out++;
                        if (out > 2) {
                            game = false;
                        }
                        break;
                }
                i++;
            }
            System.out.println(score);
        }

    }

}

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

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package kmcprocon1;

import java.util.Scanner;
public class KmcProcon1 {

    private static int[] base = {0, 0, 0};
    private static int out = 0;
    private static int score = 0;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String input = scan.next();
        int i = 0;
        String[] arr = input.split("\n");
        int dataset = Integer.parseInt(arr[0]);
        i++;
        for (int j = 0; j < dataset;  j++) {
            boolean game = true;
            score =0;
            while (game) {
                switch (arr[i]) {
                    case "HIT":
                        if (base[2] == 1) {
                            score++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            base[2] = 1;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            base[1] = 1;
                            base[0] = 0;
                        }
                        base[0] = 1;
                        break;
                    case "HOMERUN":
                        int runner = 1;
                        if (base[2] == 1) {
                            runner++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            runner++;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            runner++;
                            base[0] = 0;
                        }
                        score += runner;
                        break;
                    case "OUT":
                        out++;
                        if (out > 2) {
                            game = false;
                        }
                        break;
                }
                i++;
            }
            System.out.println(score);
        }

    }

}

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


package kmcprocon1;

import java.util.Scanner;

public class KmcProcon1 {

    public static void main(String[] args) {
        int out = 0;
        int score;
        int[] base = {0, 0, 0};
        Scanner scan = new Scanner(System.in);
        String input = scan.next();
        int i = 0;
        String[] arr = input.split("\n");
        int dataset = Integer.parseInt(arr[0]);
        i++;
        for (int j = 0; j < dataset;  j++) {
            boolean game = true;
            score =0;
            while (game) {
                switch (arr[i]) {
                    case "HIT":
                        if (base[2] == 1) {
                            score++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            base[2] = 1;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            base[1] = 1;
                            base[0] = 0;
                        }
                        base[0] = 1;
                        break;
                    case "HOMERUN":
                        int runner = 1;
                        if (base[2] == 1) {
                            runner++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            runner++;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            runner++;
                            base[0] = 0;
                        }
                        score += runner;
                        break;
                    case "OUT":
                        out++;
                        if (out > 2) {
                            game = false;
                        }
                        break;
                }
                i++;
            }
            System.out.println(score);
        }

    }

}

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

package kmcprocon1;

import java.util.Scanner;

public class KmcProcon1 {

    public static void main(String[] args) {
        int out = 0;
        int score;
        int[] base = {0, 0, 0};
        Scanner scan = new Scanner(System.in);
        int i = 0;
        int dataset = Integer.parseInt(scan.nextLine());
        i++;
        for (int j = 0; j < dataset; j++) {
            boolean game = true;
            score = 0;
            while (game) {
                switch (scan.nextLine()) {
                    case "HIT":
                        if (base[2] == 1) {
                            score++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            base[2] = 1;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            base[1] = 1;
                            base[0] = 0;
                        }
                        base[0] = 1;
                        break;
                    case "HOMERUN":
                        int runner = 1;
                        if (base[2] == 1) {
                            runner++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            runner++;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            runner++;
                            base[0] = 0;
                        }
                        score += runner;
                        break;
                    case "OUT":
                        out++;
                        if (out > 2) {
                            game = false;
                        }
                        break;
                }
                i++;
            }
            System.out.println(score);
        }

    }

}

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

package kmcprocon1;

import java.util.Scanner;

public class KmcProcon1 {

    public static void main(String[] args) {
        int out = 0;
        int score;
        int[] base = {0, 0, 0};
        Scanner scan = new Scanner(System.in);
        int i = 0;
        int dataset = Integer.parseInt(scan.nextLine());
        i++;
        for (int j = 0; j < dataset; j++) {
            boolean game = true;
            score = 0;
            out = 0;
            while (game) {
                switch (scan.nextLine()) {
                    case "HIT":
                        if (base[2] == 1) {
                            score++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            base[2] = 1;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            base[1] = 1;
                            base[0] = 0;
                        }
                        base[0] = 1;
                        break;
                    case "HOMERUN":
                        int runner = 1;
                        if (base[2] == 1) {
                            runner++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            runner++;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            runner++;
                            base[0] = 0;
                        }
                        score += runner;
                        break;
                    case "OUT":
                        out++;
                        if (out > 2) {
                            game = false;
                        }
                        break;
                }
                i++;
            }
            System.out.println(score);
        }

    }

}

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

package kmcprocon1;

import java.util.Scanner;

public class KmcProcon1 {

    public static void main(String[] args) {
        int out;
        int score;
        int[] base = {0, 0, 0};
        Scanner scan = new Scanner(System.in);
        int i = 0;
        int dataset = Integer.parseInt(scan.nextLine());
        
        for (int j = 0; j < dataset; j++) {
            boolean game = true;
            score = 0;
            out = 0;
            base[0] = 0;
            base[1] = 0;
            base[2] = 0;
            while (game) {
                switch (scan.nextLine()) {
                    case "HIT":
                        if (base[2] == 1) {
                            score++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            base[2] = 1;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            base[1] = 1;
                            base[0] = 0;
                        }
                        base[0] = 1;
                        break;
                    case "HOMERUN":
                        int runner = 1;
                        if (base[2] == 1) {
                            runner++;
                            base[2] = 0;
                        }
                        if (base[1] == 1) {
                            runner++;
                            base[1] = 0;
                        }
                        if (base[0] == 1) {
                            runner++;
                            base[0] = 0;
                        }
                        score += runner;
                        break;
                    case "OUT":
                        out++;
                        if (out > 2) {
                            game = false;
                        }
                        break;
                }
                i++;
            }
            System.out.println(score);
        }

    }

}

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

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

public class Baseball_Simulation {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		boolean[] arg = null;
		int length=0,out=0;
        int i=0;
        boolean first=true;
        int[] score=null;
        boolean[] rui=new boolean[3];
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            while ((line = br.readLine()) != null ) {
            	
            	if(first){
            		length=Integer.parseInt(line);
            		score=new int[length];
            		first=false;
            	}else{
            		if(line=="OUT"){
            			out++;
            		}else if(line=="HIT"){
            			if(rui[2]){
            				score[i]++;
            				rui[2]=false;
            			}
            			if(rui[1]){
            				rui[2]=true;
            				rui[1]=false;
            			}
            			if(rui[0]){
            				rui[1]=true;
            			}
            			rui[0]=true;
            		}else if(line=="HOMERUN"){
            			score[i]++;
            			for(int j=0;j<3;j++){
            				if(rui[j]){
            					score[i]++;
            				}
            			}

            		}
            	}
            	if(out==3){
            		rui=new boolean[3];
            		i++;
            		if(length==i){
            			break;
            		}
            	}

            }
            for(int k=0;k<score.length;k++){
            	System.out.println(score[k]);
            }
		}
	}
}

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

import java.io.*;
import java.util.ArrayList;
import java.util.List;

 
 
 
public class Main {
    
	private static List<String> base = new ArrayList<String>();
	private static int score = 0;
     
    public static void main(String[] args) {
        
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
             
            String str;
            int out = 0;
                        
            while((str = br.readLine())!=null)
            {
            	
               
                if(str.equals("HIT"))
                {
                	
                	calHit();
                	
                }
                
                if(str.equals("HOMERUN"))
                {
                	
                	calHomerun();
                	
                }
                
                if(str.equals("OUT"))
                {
                	out++;
           
                }
                
            	if(out==3)
            	{
            		System.out.println(score);  
            		break;
            	}
                
            }
            
          
           
        }catch (Exception e) {
            e.printStackTrace();
        }
        
    }
     
    private static void calHit() {
         
       if(base.size()==0 || base.size()==1 || base.size()==2)
       {
    	  base.add("Runner");
       }
       
       else if(base.size()==3)
       {
    	 score++;
       }
       
    }
     
    private static void calHomerun() {
    	
    	 score = score+base.size()+1;
    	 base.clear();
         
   }

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

import java.io.*;

public class Main {
      
    public static void main(String[] args) {
         
        try {
        	
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
            String str;
            int out = 0;
            int runner = 0;
            int score = 0;
                         
            while((str = br.readLine())!=null)
            {
                if(str.equals("HIT"))
                {
                    if(runner<3)
                    {
                    	runner++;
                    }
                    else
                    {
                    	score++;
                    }
                }
                 
                if(str.equals("HOMERUN"))
                {   
                    score = score + runner + 1;
                    runner = 0;
                }
                 
                if(str.equals("OUT"))
                {
                    out++;
                }
                 
                if(out==3)
                {
                    System.out.println(score);  
                    break; 
                }
                 
            }
             
           
            
        }catch (Exception e) {
            e.printStackTrace();
        }
         
    }

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

import java.io.*;
import java.util.*;
 
  
  
  
public class Main {
     
   // private static List<String> base = new ArrayList<String>();
   // private static int score = 0;
      
    public static void main(String[] args) {
         
        try {
        	
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
           
            int out = 0;
            int runner = 0;
            int score = 0;
            int num = Integer.parseInt(br.readLine());
            
            for(int i=0; i<num; i++)
            {
            	String str;
            	
            	while(out<3)
            	{
            		
            		str=br.readLine();
                	if(str.equals("HIT"))
                	{
                		if(runner==3)
                		{
                			score++;
                		}
                		else
                		{
                			runner++;
                		}
                	}
                 
                	else if(str.equals("HOMERUN"))
                	{
                     
                		score += runner + 1;
                		runner = 0;
                     
                	}
                 
                	else
                	{
                		out++;
            
                	}
              
            	}
          
            }
            System.out.println(score);  
        }catch (Exception e) {
            e.printStackTrace();
        }
         
    }

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.List;

public class BaseballSimulation103k {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		List<Integer> field = Arrays.asList(0,0,0);
		long scoreCount = 0;
		int outCount = 0;
		int finishedGame = 0;
		try {
			int gameNumber = br.read();
			while (finishedGame < gameNumber) {
				br = new BufferedReader(new InputStreamReader(System.in));
				switch (br.readLine()) {
				case hit:
					if(field.get(2)==1) {
						scoreCount++;
					}
					field.remove(2);
					field.add(0, 1);
					break;
				case out:
					outCount++;
					if (outCount == 3) {
						System.out.println(scoreCount);
						scoreCount = 0;
						outCount = 0;
						field = Arrays.asList(0,0,0);
						finishedGame++;
					}
					break;
				case homerun:
					field = Arrays.asList(0,0,0);
					scoreCount += 1 + field.stream().filter(base -> base==1).count();
					break;
				}
			}
			System.exit(0);

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	private final static String hit = "HIT";
	private final static String out = "OUT";
	private final static String homerun = "HOMERUN";
}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Main {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		List<Integer> field = new ArrayList<>(Arrays.asList(0,0,0));
		long scoreCount = 0;
		int outCount = 0;
		try {
			int gameNumber = Integer.parseInt(Objects.requireNonNull(br.readLine());
			while (gameNumber>0) {
				String line = Objects.requireNonNull(br.readLine());
				if(line.equals("HIT")) {
					if(field.get(2)==1) {
						scoreCount++;
					}
					field.remove(2);
					field.add(0, 1);
				}else if(line.equals("OUT")) {
					outCount++;
					if (outCount == 3) {
						System.out.println(scoreCount);
						scoreCount = 0;
						outCount = 0;
						field = new ArrayList<>(Arrays.asList(0,0,0));
						gameNumber--;
					}
				}else if(line.equals("HOMERUN")) {
					scoreCount += 1 + field.stream().filter(base -> base==1).count();
					field = new ArrayList<>(Arrays.asList(0,0,0));
				}
			}
			System.exit(0);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

Compiler output:
Main.java:15: error: ')' or ',' expected
			int gameNumber = Integer.parseInt(Objects.requireNonNull(br.readLine());
			                                                                       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Main {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		List<Integer> field = new ArrayList<>(Arrays.asList(0,0,0));
		long scoreCount = 0;
		int outCount = 0;
		try {
			int gameNumber = Integer.parseInt(Objects.requireNonNull(br.readLine());
			while (gameNumber>0) {
				String line = br.readLine();
				if(line.equals("HIT")) {
					if(field.get(2)==1) {
						scoreCount++;
					}
					field.remove(2);
					field.add(0, 1);
				}else if(line.equals("OUT")) {
					outCount++;
					if (outCount == 3) {
						System.out.println(scoreCount);
						scoreCount = 0;
						outCount = 0;
						field = new ArrayList<>(Arrays.asList(0,0,0));
						gameNumber--;
					}
				}else if(line.equals("HOMERUN")) {
					scoreCount += 1 + field.stream().filter(base -> base==1).count();
					field = new ArrayList<>(Arrays.asList(0,0,0));
				}
			}
			System.exit(0);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

Compiler output:
Main.java:15: error: ')' or ',' expected
			int gameNumber = Integer.parseInt(Objects.requireNonNull(br.readLine());
			                                                                       ^
1 error
Language: Java

import java.util.*;
public class Main {
public static void main(String[] a){
Scanner s = new Scanner(System.in);int n=Integer.valueOf(s.next());for(;n-->0;){for(int h=0,o=0;o<3;){switch(s.next().charAt(1)) {case'I':h++;if((h&3)==0)h|=3;break;case'O':h+=(((h&3)+1)<<2);h&=~3;break;default:o++;}System.out.println(h>>2)}}}}

Compiler output:
Main.java:4: error: ';' expected
Scanner s = new Scanner(System.in);int n=Integer.valueOf(s.next());for(;n-->0;){for(int h=0,o=0;o<3;){switch(s.next().charAt(1)) {case'I':h++;if((h&3)==0)h|=3;break;case'O':h+=(((h&3)+1)<<2);h&=~3;break;default:o++;}System.out.println(h>>2)}}}}
                                                                                                                                                                                                                                                ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class BaseballSimulation {

	/**
	 * @param args
	 * @throws IOException
	 * @throws NumberFormatException
	 */

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));

		int set, outcount, runs, first, second, third;
		String event;
		List<Integer> list = new ArrayList<Integer>();

		set = Integer.parseInt(bufferedReader.readLine());

		for(int i = 0; i < set; i++){
			outcount = runs = first = second = third = 0;
			while (outcount < 3) {
				event = bufferedReader.readLine();
				if (event.equals("HIT")){
					if(third == 1){
						third = 0;
						runs++;
					}
					if(second == 1){
						second = 0;
						third = 1;
					}
					if(first == 1){
						first = 0;
						second = 1;
					}
					first = 1;
				}else if(event.equals("HOMERUN")){
					runs += (first + second + third + 1);
					first = second = third = 0;
				}else if(event.equals("OUT")){
					outcount++;
				}
			}
			list.add(runs);
		}
		for(int value : list) System.out.println(value);
	}
}

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

import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t--=0){
			int runner = 0;
			int point = 0;
			int out = 0;
			while(out < 3){
				String c = sc.next();
				if(c.equals("HIT")){
					if(runner<3)runner++;
					else point++;
				}
				else if(c.equals("HOMERUN")){
					point += runner+1;
					runner = 0;
				}
				else{
					out++;
				}
			}
			System.out.println(point);
		}
	}
}

Compiler output:
Main.java:9: error: unexpected type
		while(t--=0){
		       ^
  required: variable
  found:    value
1 error
Language: C

#include <stdio.h>

int a[3];
int b[3];
int out;
int asum, bsum;

int main(void) {
	int i, j;
	int set;
	int flag = 0;
	char buf[10];
	
	scanf("%d", &set);
	for (i = 0; i < set; i++){
		scanf("%s", buf);
		if (flag == 0){
			if (buf[0] == 'H' && buf[1] == 'I'){
				asum += a[2];
				a[2] = a[1];
				a[1] = a[0];
				a[0] = 1;
			} 
			else if (buf[0] == 'H' && buf[1] == 'O'){
				asum += a[2] + a[1] + a[0];
			}
			else {
				out++;
			}
			if (out == 3){
				a[0] = a[1] = a[2] = 0;
				flag = 1;
			}	
		}
		else {
			if (buf[0] == 'H' && buf[1] == 'I'){
				bsum += b[2];
				b[2] = b[1];
				b[1] = b[0];
				b[0] = 1;
			} 
			else if (buf[0] == 'H' && buf[1] == 'O'){
				bsum += b[2] + b[1] + b[0];
			}
			else {
				out++;
			}
			if (out == 3){
				b[0] = b[1] = b[2] = 0;
				flag = 0;
			}
	}
	printf("%d\n%d\n", asum, bsum);
	// your code goes here
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:56:1: error: expected declaration or statement at end of input
   56 | }
      | ^
Language: C

#include <stdio.h>

int a[3];
int b[3];
int out;
int asum, bsum;

int main(void){
	int i;
	int set;
	int flag = 0;
	char buf[10];
	
	scanf("%d", &set);
	for (i = 0; i < set; i++){
		scanf("%s", buf);
		if (flag == 0){
			if (buf[0] == 'H' && buf[1] == 'I'){
				asum += a[2];
				a[2] = a[1];
				a[1] = a[0];
				a[0] = 1;
			} 
			else if (buf[0] == 'H' && buf[1] == 'O'){
				asum += a[2] + a[1] + a[0] + 1;
			}
			else {
				out++;
			}
			if (out == 3){
				a[0] = a[1] = a[2] = 0;
				flag = 1;
			}	
		}
		else {
			if (buf[0] == 'H' && buf[1] == 'I'){
				bsum += b[2];
				b[2] = b[1];
				b[1] = b[0];
				b[0] = 1;
			} 
			else if (buf[0] == 'H' && buf[1] == 'O'){
				bsum += b[2] + b[1] + b[0] + 1;
			}
			else {
				out++;
			}
			if (out == 3){
				b[0] = b[1] = b[2] = 0;
				flag = 0;
			}
	}
	printf("%d\n%d\n", asum, bsum);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:55:1: error: expected declaration or statement at end of input
   55 | }
      | ^
Language: C

#include <stdio.h>

int a[3];
int out;
int asum;

int main(void){
	int i;
	int set;
	char buf[10];
	
	scanf("%d", &set);
	for (i = 0; i < set; i++){
		scanf("%s", buf);
		if (buf[0] == 'H' && buf[1] == 'I'){
				asum += a[2];
				a[2] = a[1];
				a[1] = a[0];
				a[0] = 1;
			} 
			else if (buf[0] == 'H' && buf[1] == 'O'){
				asum += a[2] + a[1] + a[0] + 1;
			}
			else {
				out++;
			}
			if (out == 3){
				a[0] = a[1] = a[2] = 0;
				printf("%d\n", asum);
			}	
		}
	}
	return 0;
}

Compiler output:
main.c:33:9: error: expected identifier or '(' before 'return'
   33 |         return 0;
      |         ^~~~~~
main.c:34:1: error: expected identifier or '(' before '}' token
   34 | }
      | ^
Language: C

#include <stdio.h>

int a[3];
int out;
int sum[1000];

int main(void){
	int i;
	int set;
	char buf[10];
	
	scanf("%d", &set);
	for (i = 0; i < set; i++){
		scanf("%s", buf);
		if (buf[0] == 'H' && buf[1] == 'I'){
			sum[i] += a[2];
			a[2] = a[1];
			a[1] = a[0];
			a[0] = 1;
		} 
		else if (buf[0] == 'H' && buf[1] == 'O'){
			sum[i] += a[2] + a[1] + a[0] + 1;
		}
		else {
			out++;
		}
		
		if (out == 3){
			a[0] = a[1] = a[2] = 0;
			out = 0;
			buf = "aiueoaiueo"
		}	
	}
	for (i = 0; i < set; i++){printf("%d\n", sum[i]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:29: error: assignment to expression with array type
   31 |                         buf = "aiueoaiueo"
      |                             ^
main.c:31:43: error: expected ';' before '}' token
   31 |                         buf = "aiueoaiueo"
      |                                           ^
      |                                           ;
   32 |                 }
      |                 ~                          
main.c:36:1: error: expected declaration or statement at end of input
   36 | }
      | ^
Language: C

#include <stdio.h>

int a[3];
int out;
int sum[1000];

int main(void){
	int i;
	int set;
	char buf[10];
	
	scanf("%d", &set);
	for (i = 0; i < set; i++){
		scanf("%s", buf);
		if (buf[0] == 'H' && buf[1] == 'I'){
			sum[i] += a[2];
			a[2] = a[1];
			a[1] = a[0];
			a[0] = 1;
		} 
		else if (buf[0] == 'H' && buf[1] == 'O'){
			sum[i] += a[2] + a[1] + a[0] + 1;
		}
		else {
			out++;
		}
		
		if (out == 3){
			a[0] = a[1] = a[2] = 0;
			out = 0;
			buf = "aiueoaiueo";
		}	
	}
	for (i = 0; i < set; i++){printf("%d\n", sum[i]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:29: error: assignment to expression with array type
   31 |                         buf = "aiueoaiueo";
      |                             ^
main.c:36:1: error: expected declaration or statement at end of input
   36 | }
      | ^
Language: C

#include <stdio.h>

int a[3];
int out;
int sum[1000];

int main(void){
	int i;
	int set;
	char buf[10];
	
	scanf("%d", &set);
	for (i = 0; i < set; i++){
		scanf("%s", buf);
		if (buf[0] == 'H' && buf[1] == 'I'){
			sum[i] += a[2];
			a[2] = a[1];
			a[1] = a[0];
			a[0] = 1;
		} 
		else if (buf[0] == 'H' && buf[1] == 'O'){
			sum[i] += a[2] + a[1] + a[0] + 1;
		}
		else {
			out++;
		}
		
		if (out == 3){
			a[0] = a[1] = a[2] = 0;
			out = 0;
		}	
	}
	for (i = 0; i < set; i++){printf("%d\n", sum[i]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:1: error: expected declaration or statement at end of input
   35 | }
      | ^
Language: C

#include <stdio.h>

int a[3];
int out;
int sum[1000];

int main(void){
	int i;
	int set;
	char buf[10];
	
	scanf("%d", &set);
	for (i = 0; i < set; i++){
		scanf("%s", buf);
			sum[i] += a[2];
			a[2] = a[1];
			a[1] = a[0];
			a[0] = 1;
		} 
		else if (buf[0] == 'H' && buf[1] == 'O'){
			sum[i] += a[2] + a[1] + a[0] + 1;
		}
		else {
			out++;
		}
		
		if (out == 3){
			a[0] = a[1] = a[2] = 0;
			out = 0;
		}
	}
	for (i = 0; i < set; i++){printf("%d\n", sum[i])};
	return 0;
}

		if (buf[0] == 'H' && buf[1] == 'I'){

Compiler output:
main.c: In function 'main':
main.c:20:17: error: 'else' without a previous 'if'
   20 |                 else if (buf[0] == 'H' && buf[1] == 'O'){
      |                 ^~~~
main.c: At top level:
main.c:32:9: error: expected identifier or '(' before 'for'
   32 |         for (i = 0; i < set; i++){printf("%d\n", sum[i])};
      |         ^~~
main.c:32:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   32 |         for (i = 0; i < set; i++){printf("%d\n", sum[i])};
      |                       ^
main.c:32:31: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   32 |         for (i = 0; i < set; i++){printf("%d\n", sum[i])};
      |                               ^~
main.c:33:9: error: expected identifier or '(' before 'return'
   33 |         return 0;
      |         ^~~~~~
main.c:34:1: error: expected identifier or '(' before '}' token
   34 | }
      | ^
main.c:36:17: error: expected identifier or '(' before 'if'
   36 |                 if (buf[0] == 'H' && buf[1] == 'I'){
      |                 ^~
Language: C

#include <stdio.h>

int a[3];
int out;
int sum[1000];

int main(void){
	int i;
	int set;
	char buf[10];
	
	scanf("%d", &set);
	for (i = 0; i < set; i++){
		scanf("%s", buf);
		if (buf[0] == 'H' && buf[1] == 'I'){
			sum[i] += a[2];
			a[2] = a[1];
			a[1] = a[0];
			a[0] = 1;
		}
		else if (buf[0] == 'H' && buf[1] == 'O'){
			sum[i] += a[2] + a[1] + a[0] + 1;
		}
		else {
			out++;
		}
		
		if (out == 3){
			a[0] = a[1] = a[2] = 0;
			out = 0;
		}
	}
	for (i = 0; i < set; i++){printf("%d\n", sum[i])};
	return 0;
}

		if (buf[0] == 'H' && buf[1] == 'I'){

Compiler output:
main.c: In function 'main':
main.c:33:57: error: expected ';' before '}' token
   33 |         for (i = 0; i < set; i++){printf("%d\n", sum[i])};
      |                                                         ^
      |                                                         ;
main.c: At top level:
main.c:37:17: error: expected identifier or '(' before 'if'
   37 |                 if (buf[0] == 'H' && buf[1] == 'I'){
      |                 ^~
Language: C

#include <stdio.h>
#include <string.h>

int a[3];
int out;
int sum;

int main(void){
	int i;
	int set;
	char buf[8];
	char hit[4] = "HIT", out[4]="OUT", homerun[8]="HOMERUN";
	
	scanf("%d", &set);
	for (i = 0; i < set; i++){
		scanf("%s", buf);
		if (strcmp(buf, hit) > 0){
			sum += a[2];
			a[2] = a[1];
			a[1] = a[0];
			a[0] = 1;
		}
		else if (strcmp(buf, homerun) > 0){
			sum += a[2] + a[1] + a[0] + 1;
		}
		else if (strcmp(buf, out) > 0){
			out++;
		}
		
		if (out == 3){
			a[0] = a[1] = a[2] = 0;
			out = 0;
			sum = 0;
			printf("%d\n", sum);
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:28: error: lvalue required as increment operand
   27 |                         out++;
      |                            ^~
main.c:30:25: warning: comparison between pointer and integer
   30 |                 if (out == 3){
      |                         ^~
main.c:32:29: error: assignment to expression with array type
   32 |                         out = 0;
      |                             ^
Language: C

#include<stdio.h>
#include<iostream>
using namespace std;
int main(void)
{
	int n,i=0,out=0,g=0;
	int cange=0,score[2]={0,0};
	char evn[100][7];
	int base[4]={0,0,0,0};
	cin >> n;
	while(n!=g){
		cin >> evn[i];
		if(evn[i][1]=='I'){
			base[3]+=base[2];
			base[2]=base[1];
			base[1]=base[0];
			base[0]=1;
		}
		if(evn[i][1]=='O'){
			base[3]+=base[2]+base[1]+base[0]+1;
			base[2]=0;base[1]=0;base[0]=0;
		}
		if(evn[i][0]=='O'){
			out++;
		}
		if(out==3){
			out=0;
			base[0]=0;
			base[1]=0;
			base[2]=0;
			if(cange==0){
			score[0]=base[3];
			base[3]=0;
			cange=1;
			g++;
			}
			else{
				score[1]=base[3];
				score[3]=0;
				cange=0;
				g++;
			}
		}
	}
	cout << score[0] << endl <<score[1];
return 0;
}

Compiler output:
main.c:2:9: fatal error: iostream: No such file or directory
    2 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.