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

#include <iostream>

class Baseball{

private:
	int point;
	int out;
	int base;   //0:no runner 1:runner
				//home,third,second,first

public:

	Baseball(){
		point = 0;
		out = 0;
		base = 0;
	}

	int point(){
		return point;
	}

	int out(){
		return out;
	}

	void hit(){
		base = (base * 10) + 1;
		
		if(base >= 1000){
			base -= 1000;
			point += 1;
		}
	}

	void home_run(){
		point += 1;
		for(int i = base; i > 0; i /= 10){
			point += i%10;
		}
		base = 0;
	}

	void get_out(){
		out += 1;
	}
};	

int main(){

	int N;
	std::cin >> N;

	for(int i = 0; i < N; ++i){
		Baseball baseball();

		while(baseball.out() != 3){
			std::string str;
			std::cin >> str;

			if(str == "HIT")
				baseball.hit();
			
			else if(str == "HOMERUN")
				baseball.home_run();

			else if(str == "OUT")
				baseball.get_out();

		}

		std::cout >> baseball.point() >> std::endl;
	}

	return 0;
{
	
	

Compiler output:
a.cc:21:9: error: 'int Baseball::point()' conflicts with a previous declaration
   21 |         }
      |         ^
a.cc:6:13: note: previous declaration 'int Baseball::point'
    6 |         int point;
      |             ^~~~~
a.cc:25:9: error: 'int Baseball::out()' conflicts with a previous declaration
   25 |         }
      |         ^
a.cc:7:13: note: previous declaration 'int Baseball::out'
    7 |         int out;
      |             ^~~
a.cc: In function 'int main()':
a.cc:55:34: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   55 |                 Baseball baseball();
      |                                  ^~
a.cc:55:34: note: remove parentheses to default-initialize a variable
   55 |                 Baseball baseball();
      |                                  ^~
      |                                  --
a.cc:55:34: note: or replace parentheses with braces to value-initialize a variable
a.cc:57:32: error: request for member 'out' in 'baseball', which is of non-class type 'Baseball()'
   57 |                 while(baseball.out() != 3){
      |                                ^~~
a.cc:62:42: error: request for member 'hit' in 'baseball', which is of non-class type 'Baseball()'
   62 |                                 baseball.hit();
      |                                          ^~~
a.cc:65:42: error: request for member 'home_run' in 'baseball', which is of non-class type 'Baseball()'
   65 |                                 baseball.home_run();
      |                                          ^~~~~~~~
a.cc:68:42: error: request for member 'get_out' in 'baseball', which is of non-class type 'Baseball()'
   68 |                                 baseball.get_out();
      |                                          ^~~~~~~
a.cc:72:39: error: request for member 'point' in 'baseball', which is of non-class type 'Baseball()'
   72 |                 std::cout >> baseball.point() >> std::endl;
      |                                       ^~~~~
a.cc:76:2: error: expected '}' at end of input
   76 | {
      | ~^
a.cc:76:2: error: expected '}' at end of input
a.cc:49:11: note: to match this '{'
   49 | int main(){
      |           ^
Language: C++

#include <iostream>

class Baseball{

private:
	int point;
	int out;
	int base;   //0:no runner 1:runner
				//home,third,second,first

public:

	Baseball(){
		point = 0;
		out = 0;
		base = 0;
	}

	int get_point(){
		return point;
	}

	int get_out(){
		return out;
	}

	void hit(){
		base = (base * 10) + 1;
		
		if(base >= 1000){
			base -= 1000;
			point += 1;
		}
	}

	void home_run(){
		point += 1;
		for(int i = base; i > 0; i /= 10){
			point += i%10;
		}
		base = 0;
	}

	void add_out(){
		out += 1;
	}
};	

int main(){

	int N;
	std::cin >> N;

	for(int i = 0; i < N; ++i){
		Baseball baseball();

		while(baseball.get_out() != 3){
			std::string str;
			std::cin >> str;

			if(str == "HIT")
				baseball.hit();
			
			else if(str == "HOMERUN")
				baseball.home_run();

			else if(str == "OUT")
				baseball.add_out();

		}

		std::cout >> baseball.get_point() >> std::endl;
	}

	return 0;
{
	
	

Compiler output:
a.cc: In function 'int main()':
a.cc:55:34: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   55 |                 Baseball baseball();
      |                                  ^~
a.cc:55:34: note: remove parentheses to default-initialize a variable
   55 |                 Baseball baseball();
      |                                  ^~
      |                                  --
a.cc:55:34: note: or replace parentheses with braces to value-initialize a variable
a.cc:57:32: error: request for member 'get_out' in 'baseball', which is of non-class type 'Baseball()'
   57 |                 while(baseball.get_out() != 3){
      |                                ^~~~~~~
a.cc:62:42: error: request for member 'hit' in 'baseball', which is of non-class type 'Baseball()'
   62 |                                 baseball.hit();
      |                                          ^~~
a.cc:65:42: error: request for member 'home_run' in 'baseball', which is of non-class type 'Baseball()'
   65 |                                 baseball.home_run();
      |                                          ^~~~~~~~
a.cc:68:42: error: request for member 'add_out' in 'baseball', which is of non-class type 'Baseball()'
   68 |                                 baseball.add_out();
      |                                          ^~~~~~~
a.cc:72:39: error: request for member 'get_point' in 'baseball', which is of non-class type 'Baseball()'
   72 |                 std::cout >> baseball.get_point() >> std::endl;
      |                                       ^~~~~~~~~
a.cc:76:2: error: expected '}' at end of input
   76 | {
      | ~^
a.cc:76:2: error: expected '}' at end of input
a.cc:49:11: note: to match this '{'
   49 | int main(){
      |           ^
Language: C++

#include <iostream>

class Baseball{

private:
	int point;
	int out;
	int base;   //0:no runner 1:runner
				//home,third,second,first

public:

	Baseball(){
		point = 0;
		out = 0;
		base = 0;
	}

	int get_point(){
		return point;
	}

	int get_out(){
		return out;
	}

	void hit(){
		base = (base * 10) + 1;
		
		if(base >= 1000){
			base -= 1000;
			point += 1;
		}
	}

	void home_run(){
		point += 1;
		for(int i = base; i > 0; i /= 10){
			point += i%10;
		}
		base = 0;
	}

	void add_out(){
		out += 1;
	}
};	

int main(){

	int N;
	std::cin >> N;

	for(int i = 0; i < N; ++i){
		Baseball baseball();

		while(baseball.get_out() != 3){
			std::string str;
			std::cin >> str;

			if(str == "HIT")
				baseball.hit();
			
			else if(str == "HOMERUN")
				baseball.home_run();

			else if(str == "OUT")
				baseball.add_out();

		}

		std::cout >> baseball.get_point() >> std::endl;
	}

	return 0;
}

	

Compiler output:
a.cc: In function 'int main()':
a.cc:55:34: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   55 |                 Baseball baseball();
      |                                  ^~
a.cc:55:34: note: remove parentheses to default-initialize a variable
   55 |                 Baseball baseball();
      |                                  ^~
      |                                  --
a.cc:55:34: note: or replace parentheses with braces to value-initialize a variable
a.cc:57:32: error: request for member 'get_out' in 'baseball', which is of non-class type 'Baseball()'
   57 |                 while(baseball.get_out() != 3){
      |                                ^~~~~~~
a.cc:62:42: error: request for member 'hit' in 'baseball', which is of non-class type 'Baseball()'
   62 |                                 baseball.hit();
      |                                          ^~~
a.cc:65:42: error: request for member 'home_run' in 'baseball', which is of non-class type 'Baseball()'
   65 |                                 baseball.home_run();
      |                                          ^~~~~~~~
a.cc:68:42: error: request for member 'add_out' in 'baseball', which is of non-class type 'Baseball()'
   68 |                                 baseball.add_out();
      |                                          ^~~~~~~
a.cc:72:39: error: request for member 'get_point' in 'baseball', which is of non-class type 'Baseball()'
   72 |                 std::cout >> baseball.get_point() >> std::endl;
      |                                       ^~~~~~~~~
Language: C++

#include <iostream>
#include <string>

class Baseball{

private:
	int point;
	int out;
	int base;   //0:no runner 1:runner
				//home,third,second,first

public:

	Baseball(){
		point = 0;
		out = 0;
		base = 0;
	}

	int get_point(){
		return point;
	}

	int get_out(){
		return out;
	}

	void hit(){
		base = (base * 10) + 1;
		
		if(base >= 1000){
			base -= 1000;
			point += 1;
		}
	}

	void home_run(){
		point += 1;
		for(int i = base; i > 0; i /= 10){
			point += i%10;
		}
		base = 0;
	}

	void add_out(){
		out += 1;
	}
};	

int main(){

	int N;
	std::cin >> N;

	for(int i = 0; i < N; ++i){

		Baseball baseball();

		while(baseball.get_out() != 3){
			std::string str;
			std::cin >> str;

			if(str == "HIT")
				baseball.hit();
			
			else if(str == "HOMERUN")
				baseball.home_run();

			else if(str == "OUT")
				baseball.add_out();

		}

		std::cout >> baseball.get_point() >> std::endl;
	}

	return 0;
}

	

Compiler output:
a.cc: In function 'int main()':
a.cc:57:34: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   57 |                 Baseball baseball();
      |                                  ^~
a.cc:57:34: note: remove parentheses to default-initialize a variable
   57 |                 Baseball baseball();
      |                                  ^~
      |                                  --
a.cc:57:34: note: or replace parentheses with braces to value-initialize a variable
a.cc:59:32: error: request for member 'get_out' in 'baseball', which is of non-class type 'Baseball()'
   59 |                 while(baseball.get_out() != 3){
      |                                ^~~~~~~
a.cc:64:42: error: request for member 'hit' in 'baseball', which is of non-class type 'Baseball()'
   64 |                                 baseball.hit();
      |                                          ^~~
a.cc:67:42: error: request for member 'home_run' in 'baseball', which is of non-class type 'Baseball()'
   67 |                                 baseball.home_run();
      |                                          ^~~~~~~~
a.cc:70:42: error: request for member 'add_out' in 'baseball', which is of non-class type 'Baseball()'
   70 |                                 baseball.add_out();
      |                                          ^~~~~~~
a.cc:74:39: error: request for member 'get_point' in 'baseball', which is of non-class type 'Baseball()'
   74 |                 std::cout >> baseball.get_point() >> std::endl;
      |                                       ^~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <map>
#include <functional>
#include <cmath>
#include <cstdio>
using namespace std;

#define PI 4*atan(1)

int main(){
  int n;
  cin >> n;
  for(int i = 0; i < n; i++){
    bool base[3] = {false};
    int point = 0, out = 0;
    while(1){
      char s[8];
      cin >> s;
      if(strcmp(s, "HIT") == 0){
        if(base[2] == true){
          point += 1;
          base[2] = false;
        }
        if(base[1] == true){
          base[1] = false;
          base[2] = true;
        }
        if(base[0] == true){
          base[0] = false;
          base[1] = true;
        }
        base[0] = true;
      }
      if(strcmp(s, "OUT") == 0){
        out++;
        if(out == 3)break;
      }
      if(strcmp(s, "HOMERUN") == 0){
        for(int j = 0; j < 3; j++){
          if(base[i] == true){
            base[i] = false;
            point++;
          }
        }
        point++;
      }
    }
    cout << point << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:10: error: 'strcmp' was not declared in this scope
   23 |       if(strcmp(s, "HIT") == 0){
      |          ^~~~~~
a.cc:10:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include <cstdio>
  +++ |+#include <cstring>
   10 | using namespace std;
a.cc:38:10: error: 'strcmp' was not declared in this scope
   38 |       if(strcmp(s, "OUT") == 0){
      |          ^~~~~~
a.cc:38:10: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:42:10: error: 'strcmp' was not declared in this scope
   42 |       if(strcmp(s, "HOMERUN") == 0){
      |          ^~~~~~
a.cc:42:10: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<iostream>
#include<string>
using namespace std;

int main(){
	bool F,S,T	//???
	int out,point;
	
	int i,j;
	
	int dataN,dataLoop;
	string E;	//????????????
	
	cin>>dataN;
	for(dataLoop=0;dataLoop<dataN;dataLoop++){
	//????????????
	out=0;point=0;
	while(out==3){
	 cin>>E;
	 switch(E){
		case "HIT":
		if(T){point++;}
		T=S;S=F;F=true;
		break;
		case "HOMERUN":
		point++;
		if(F){point++;F=false;}
		if(S){point++;S=false;}
		if(T){point++;T=false;}
		break;
		case "OUT":
		out++;
		break;
	 }
	}
	cout<<point<<endl;
	//???????????§
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected initializer before 'int'
    7 |         int out,point;
      |         ^~~
a.cc:17:9: error: 'out' was not declared in this scope
   17 |         out=0;point=0;
      |         ^~~
a.cc:17:15: error: 'point' was not declared in this scope
   17 |         out=0;point=0;
      |               ^~~~~
a.cc:20:17: error: switch quantity not an integer
   20 |          switch(E){
      |                 ^
a.cc:22:20: error: 'T' was not declared in this scope
   22 |                 if(T){point++;}
      |                    ^
a.cc:23:17: error: 'T' was not declared in this scope
   23 |                 T=S;S=F;F=true;
      |                 ^
Language: C++

#include<iostream>
#include<string>
using namespace std;

int main(){
	bool F,S,T;	//???
	int out,point;
	
	int i,j;
	
	int dataN,dataLoop;
	string E;	//????????????
	
	cin>>dataN;
	for(dataLoop=0;dataLoop<dataN;dataLoop++){
	//????????????
	out=0;point=0;
	while(out==3){
	 cin>>E;
	 switch(E){
		case "HIT":
		if(T){point++;}
		T=S;S=F;F=true;
		break;
		case "HOMERUN":
		point++;
		if(F){point++;F=false;}
		if(S){point++;S=false;}
		if(T){point++;T=false;}
		break;
		case "OUT":
		out++;
		break;
	 }
	}
	cout<<point<<endl;
	//???????????§
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: switch quantity not an integer
   20 |          switch(E){
      |                 ^
Language: C++

#include<stdio.h>

int main(void)
{
  char str[16]={};
  int n;
  int score=0;
  int base=0;
  int out=0;

  scanf("%d", &n);

  for(i=0;i<n;i++)
    {
      scanf("%s", str);
      if(str[1]='I')
        if(base==3)
          score++,base=0;
        else
          base++;
      else if(str[1]='U')
        if(out==2)
          out=base=0;
        else
          out++;
      else if(str[1]='O')
	score+=base+1,base=0;
    }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   for(i=0;i<n;i++)
      |       ^
Language: C++

#include <iostream>
#include <string>

int main(){
  int n;
  int base[3];
  int out, score;
  
  string event;
  std::cin >> n;
  for(int i=0; i<n; i++){
    base[0] = 0;
    base[1] = 0;
    base[2] = 0;
    out = 0;
    score = 0;
    while(out!=3){
      std::cin >> event;
      if(event=="HIT"){
        if(base[2]>=1){
          base[2]--;
          score++;
        }
        if(base[1]>=1){
          base[1]--;
          base[2]++;
        }
        if(base[0]>=1){
          base[0]--;
          base[1]++;
        }
        base[0]++;
      }else if(event=="HOMERUN"){
        score += base[2];
        base[2] = 0;
        score += base[1];
        base[1] = 0;
        score += base[0];
        base[0] = 0;
      }else{
        out++; 
      }
    }
    std::cout << score << std::endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'string' was not declared in this scope
    9 |   string event;
      |   ^~~~~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:18:19: error: 'event' was not declared in this scope
   18 |       std::cin >> event;
      |                   ^~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
 int n;
 cin>>n;
 while(n){
  int o=0,a=0,b=0;
  while(o!=3){
   string s;
   cin>>s;
   if(s=="HIT"){
    if(b==3){
     a++;
    }
    else b++;
    }
   }
   else if(s=="OUT")o++;
   else{
   a+=++b;
   b=0;
   }
  }
  cout<<a<<endl;
  n--;
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:4: error: 'else' without a previous 'if'
   18 |    else if(s=="OUT")o++;
      |    ^~~~
a.cc:18:12: error: 's' was not declared in this scope
   18 |    else if(s=="OUT")o++;
      |            ^
a.cc:24:9: error: 'a' was not declared in this scope
   24 |   cout<<a<<endl;
      |         ^
a.cc: At global scope:
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

for i in range(int(input())):
    f, s, t, count, point = 0, 0, 0, 0, 0
    while count != 3:
        data = input()
        if data == 'HIT':
            if t == 1:
                point += 1
                t = 0
            if s == 1:
                t = 1
                s = 0
            if f == 1:
                s = 1
            f = 1
        elif data == 'OUT':
            count += 1
        elif data == 'HO' \
                   '' :
            point += f + s + t + 1
            f, s, t = 0, 0, 0
    print(point)

Compiler output:
a.cc:5:20: warning: multi-character character constant [-Wmultichar]
    5 |         if data == 'HIT':
      |                    ^~~~~
a.cc:15:22: warning: multi-character character constant [-Wmultichar]
   15 |         elif data == 'OUT':
      |                      ^~~~~
a.cc:17:22: warning: multi-character character constant [-Wmultichar]
   17 |         elif data == 'HO' \
      |                      ^~~~
a.cc:18:20: error: empty character constant
   18 |                    '' :
      |                    ^~
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for i in range(int(input())):
      | ^~~
Language: C++

#include <iostream>
#include <string>

int main(){
    int hit, out, score, data_set_num;
    std::string event;
    cin >> data_set_num;


    while(data_set_num--){
        cin >> event;
        if(event == "HIT"){
            ++hit;
            if(hit == 4){
                ++score;
                hit = 3;
            }
        }else if(event == "HOMERUN"){
            score += (hit + 1);
            hit = 0;
        }else if(event == "OUT"){
            ++out;
        }

        if(out == 3){
            std::cout << score << std::endl;
            hit = 0;
            core = 0;
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     cin >> data_set_num;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:28:13: error: 'core' was not declared in this scope; did you mean 'score'?
   28 |             core = 0;
      |             ^~~~
      |             score
Language: C++


#include <iostream>
#include <string>
#include <fstream>

int main(){
    int hit, out, score, data_set_num;
    std::string event;
    std::getline(std::cin,str);
    sscanf(str.c_str(),"%d ",&data_set_num);

    while(data_set_num--){
        std::cin >> event;
        if(event == "HIT"){
            ++hit;
            if(hit == 4){
                ++score;
                hit = 3;
            }
        }else if(event == "HOMERUN"){
            score += (hit + 1);
            hit = 0;
        }else if(event == "OUT"){
            ++out;
        }

        if(out == 3){
            std::cout << score << std::endl;
            hit = 0;
            score = 0;
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:27: error: 'str' was not declared in this scope; did you mean 'std'?
    9 |     std::getline(std::cin,str);
      |                           ^~~
      |                           std
Language: C++

#include <iostream>
#include <array>

class Baseball{
private:
    int m_runner = 0;
    int m_out = 0;
    int m_point = 0;

public:
    void isHit(){
        if(m_runner < 3){
            ++m_runner;
        //if fill all base    
        } else {
            ++m_point;
        }
    }
    void isHomerun(){
        //add point and reset runner
        m_point += m_runner + 1;
        m_runner = 0;
    }
    void setOut(){
        ++m_out;
    }
    int getOut(){
        return m_out;
    }
    int getPoint(){
        return m_point;
    }

    void resetInning(){
        m_runner = 0;
        m_out = 0;
        m_point = 0;
    }
};

int main(){
    int n;
    std::string event;

    std::cin >> n;
    Baseball baseball;
    for(int i = 0; i < n; ++i){
        //until out count = 3
        while(baseball.getOut() < 3) {
            //input event
            std::cin >> event;
            if (event == "HIT") {
                baseball.isHit();
            } else if (event == "OUT") {
                baseball.setOut();
            } else if (event == "HOMERUN"){
                baseball.isHomerun();
            }
        }
        std::cout << baseball.getPoint() << std::endl;
        resetInning();
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:9: error: 'resetInning' was not declared in this scope
   61 |         resetInning();
      |         ^~~~~~~~~~~
Language: C++

//0103
#include<string.h>
#include<stdio.h>
int main()
{
	int n,op,f,se,t,r;
	char s[16];
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		r=0;
		op=0;
		f=0;
		se=0;
		t=0;

		while(op<3){
			scanf("%s",s);
			if(strcmp("OUT",s)==0){
				op++;
			}else if(strcmp("HIT",s)){
				r+=t;
				t=se;
				se=f;
				f++;
			}else{
				r+=(f+se+t+1);
				f=s=t=0;
			}
		}
		printf("%d\n",r-3);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:36: error: incompatible types in assignment of 'int' to 'char [16]'
   27 |                                 f=s=t=0;
      |                                   ~^~~~
Language: C++

#include <string>
using namespace std;

int base[3];
int point = 0;
int out = 0;
int n;

//イニング終わり
void reset_base() {
	for (int i = 0; i < 3; ++i) {
		base[i] = 0;
	}
}

//シングルヒット
void Single_hit() {
	point += base[2];
	base[2] = base[1];
	base[1] = base[0];
	base[0] = 1;
}

//ホームラン
void HomeRun() {
	for (int i = 0; i < 2; ++i) {
		point += base[i];
		base[i] = 0;
	}
	++point;
}

void Out() {
	++out;
	if (out == 3) {
		reset_base();
		out = 0;
		cout << point << endl;
		point = 0;
		--n;
	}
}


int main() {
	cin >> n;
	string s;
	while (n) {
		cin >> s;
		if (s == "HIT") {
			Single_hit();
		}
		else if (s == "HOMERUN") {
			HomeRun();
		}
		else if (s == "OUT") {
			Out();
		}
	}
}


Compiler output:
a.cc: In function 'void Out()':
a.cc:38:17: error: 'cout' was not declared in this scope
   38 |                 cout << point << endl;
      |                 ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:38:34: error: 'endl' was not declared in this scope
   38 |                 cout << point << endl;
      |                                  ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc: In function 'int main()':
a.cc:46:9: error: 'cin' was not declared in this scope
   46 |         cin >> n;
      |         ^~~
a.cc:46:9: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<cstdio>

int main() {
	bool a = false, b = false, c = false;
	int score = 0;
	char event[10];
	int d;
	scanf_s("%d", &d, 10);
	for (int i = 0; i<d; i++) {
		score = 0;
		a = b = c = false;
		int out = 0;
		while (1) {
			scanf_s("%s", &event, 10);
			if (event[1] == 'I') {
				if (c)score++;
				c = b;
				b = a;
				a = true;
			}
			else if (event[1] == 'O') {
				score++;
				if (a)score++;
				if (b)score++;
				if (c)score++;
				a = b = c = false;
			}
			else out++;
			if (out == 3) {
				printf("%d\n", score);
				break;
			}
		}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d", &d, 10);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
#include <queue>
#include <string>


class Baseball {
public:
    int score;                //得点
    int count;                //アウトカウント
    std::queue<int> runner;   //ランナー

    //コンストラクタ
    Baseball(int sc,int co){
        score = sc;
        count = co;
        while(!runner.empty()){
            runner.pop();
        }
    }
    
    //ヒット
    void hit(){
        if(runner.size() == 3){
            ++score;
        }
    }
    
    //ホームラン
    void homerun(){
        while(!runner.empty()){
            ++score;
            runner.pop();
        }
        ++score;;
    }
    
    //アウト
    void out(){
        ++count;
    }
};


int main(){
    int n;
    std::string event;
    
    std::cin >> n;
    
    Baseball game(0,0);
    
    while(n > 0 && std::cin >> event){
        switch(event){
            case 'HIT':
                game.hit();
                break;
            case 'HOMERUN':
                game.homerun();
                break;
            case 'OUT':
                game.out();
        }
        if(game.count == 3){
            --n;
            std::cout << game.score << std::endl;
            game = Baseball(0,0);
        }
    }
}


Compiler output:
a.cc:54:18: warning: multi-character character constant [-Wmultichar]
   54 |             case 'HIT':
      |                  ^~~~~
a.cc:57:18: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
   57 |             case 'HOMERUN':
      |                  ^~~~~~~~~
a.cc:60:18: warning: multi-character character constant [-Wmultichar]
   60 |             case 'OUT':
      |                  ^~~~~
a.cc: In function 'int main()':
a.cc:53:16: error: switch quantity not an integer
   53 |         switch(event){
      |                ^~~~~
Language: C++

#include <iostream>
#include <queue>
#include <string>


class Baseball {
public:
    int score;                //得点
    int count;                //アウトカウント
    std::queue<int> runner;   //ランナー

    //コンストラクタ
    Baseball(int sc,int co){
        score = sc;
        count = co;
        while(!runner.empty()){
            runner.pop();
        }
    }
    
    //ヒット
    void hit(){
        if(runner.size() == 3){
            ++score;
        }
    }
    
    //ホームラン
    void homerun(){
        while(!runner.empty()){
            ++score;
            runner.pop();
        }
        ++score;
    }
    
    //アウト
    void out(){
        ++count;
    }
};


int main(){
    int n;
    std::string event;
    
    std::cin >> n;
    
    Baseball game(0,0);
    
    while(n > 0 && std::cin >> event){
        if(event == "HIT")
            game.hit();
        else if(event == "HOMERUN")
            game.homerun();
        else
            game.out();
        }
        if(game.count == 3){
            --n;
            std::cout << game.score << std::endl;
            game = Baseball(0,0);
        }
    }
}


Compiler output:
a.cc:66:1: error: expected declaration before '}' token
   66 | }
      | ^
Language: C++

#include <iostream>
#include <string>

int base;

int hit(){
	if(base==3) return 1;
	else base++;
	return 0;
}

int homerun(){
	base++;
	return base;
}

int main(){
	int inning;
	std::cin >> inning;

	for(int i=0;i<inning;i++){
		int outCount=0;
		int point=0;
		string result;
		base=0;
		while(outCount<3){
			std::cin >> result;

			if(result == "HIT"){
				point += hit();
			} else if(result == "HOMERUN"){
				point += homerun();
				base=0;
			} else if(result == "OUT"){
				outCount++;
			}
		}
		std::cout << point << std::endl;
	}

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'string' was not declared in this scope
   24 |                 string result;
      |                 ^~~~~~
a.cc:24:17: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:27:37: error: 'result' was not declared in this scope
   27 |                         std::cin >> result;
      |                                     ^~~~~~
Language: C++

#include <iostream>
#include <string>

class Baseball{
private:
	int first;
	int second;
	int third;
	int score;
	int count;
public:
	Baseball(){
		first=0;
		second=0;
		third=0;
		score=0;
		count=0;
	}
	int score(){
		return score;
	}
	void hit(){
		score+=third;
		third=second;
		second=first;
		first=1;
	}
	void homerun(){
		score+=third+second+first+1;
		first=0;
		second=0;
		third=0;
	}
	void out(){
		count++;
	}
	int count(){
		return count;
	}
}

int main(){
	int inning;
	std::cin >> inning;

	for(int i=0;i<inning;i++){
		Baseball attack;
		std::string result;
		while(attack.count()<3){
			std::cin >> result;

			if(result == "HIT"){
				attack.hit();
			} else if(result == "HOMERUN"){
				attack.homerun();
			} else if(result == "OUT"){
				attack.out();
			}
		}
		std::cout << attack.score() <<std::endl;
	}

    return 0;
}


Compiler output:
a.cc:21:9: error: 'int Baseball::score()' conflicts with a previous declaration
   21 |         }
      |         ^
a.cc:9:13: note: previous declaration 'int Baseball::score'
    9 |         int score;
      |             ^~~~~
a.cc:39:9: error: 'int Baseball::count()' conflicts with a previous declaration
   39 |         }
      |         ^
a.cc:10:13: note: previous declaration 'int Baseball::count'
   10 |         int count;
      |             ^~~~~
a.cc:40:2: error: expected ';' after class definition
   40 | }
      |  ^
      |  ;
a.cc: In function 'int main()':
a.cc:49:30: error: 'int Baseball::count' is private within this context
   49 |                 while(attack.count()<3){
      |                              ^~~~~
a.cc:10:13: note: declared private here
   10 |         int count;
      |             ^~~~~
a.cc:49:35: error: expression cannot be used as a function
   49 |                 while(attack.count()<3){
      |                       ~~~~~~~~~~~~^~
a.cc:60:37: error: 'int Baseball::score' is private within this context
   60 |                 std::cout << attack.score() <<std::endl;
      |                                     ^~~~~
a.cc:9:13: note: declared private here
    9 |         int score;
      |             ^~~~~
a.cc:60:42: error: expression cannot be used as a function
   60 |                 std::cout << attack.score() <<std::endl;
      |                              ~~~~~~~~~~~~^~
Language: C++

#include <iostream>
#include <string>

class Baseball{
private:
	int first;
	int second;
	int third;
	int score;
	int count;
public:
	Baseball(){
		first=0;
		second=0;
		third=0;
		score=0;
		count=0;
	}
	int getScore(){
		return score;
	}
	void hit(){
		score+=third;
		third=second;
		second=first;
		first=1;
	}
	void homerun(){
		score+=third+second+first+1;
		first=0;
		second=0;
		third=0;
	}
	void out(){
		count++;
	}
	int getCount(){
		return count;
	}
}

int main(){
	int inning;
	std::cin >> inning;

	for(int i=0;i<inning;i++){
		Baseball attack;
		std::string result;
		while(attack.getCount()<3){
			std::cin >> result;

			if(result == "HIT"){
				attack.hit();
			} else if(result == "HOMERUN"){
				attack.homerun();
			} else if(result == "OUT"){
				attack.out();
			}
		}
		std::cout << attack.getScore() <<std::endl;
	}

    return 0;
}


Compiler output:
a.cc:40:2: error: expected ';' after class definition
   40 | }
      |  ^
      |  ;
Language: C++

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

int main(void)
{
	int base=0,out=0,score=0,e,i,j;
	char str[10];
	scanf("%d",&e);
	if(e==0)break;
	for(i=0;i<e;){
		scanf("%s",&str);
		if(!strcmp(str,"HIT"))base++;
		
		else if(!strcmp(str,"OUT")){
			out++;
		}
		
		else if(!strcmp(str,"HOMERUN")){
			score=score+base+1;
			base=0;
		}
		if(base>3){
			base--;
			score++;
		}
		if(out==3){
			out=0;
			printf("%d\n",score);
			i++;
			base=0;
			score=0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: break statement not within loop or switch
    9 |         if(e==0)break;
      |                 ^~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
    int n;
    string ins;
    cin>>n;
    for(int ix=0;ix<n;ix++){
        int out=0,po=0;
        vector<bool> runner(3,false);
        for(;;){
            cin>>ins;
            if(ins=="HIT"){
                if(runner[2]){
                    po++;
                    runner[2]=false;
                }
                if(runner[1]){
                    runner[2]=true;
                    runner[1]=false;
                }
                if(runner[0]) runner[1]=true;
                runner[0]=true;
            }else if(ins=="OUT"){
                out++;
                if(out==3)break;
            }else if(ins=="HOMERUN"){
                po++;
                for(int i=0;i<3;i++){
                    if(runner[i])po++;
                    runner[i]=false;
                }
            }
        }
        cout<<po<<enld;
        printf("%d\n",po);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:19: error: 'enld' was not declared in this scope
   35 |         cout<<po<<enld;
      |                   ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

void solve()
{
	int n;
	cin >> n;
	while(n--)
	{
		int point = 0;
		int outcount = 0;
		bool runner[3];
		memset(runner, 0, sizeof(bool) * 3);
		while(true)
		{
			string str;
			cin >> str;
			if(str == "HIT")
			{
				if(runner[2])
				{
					point++;
				}
				for(int i = 1; i >= 0; --i)
				{
					if(runner[i])
					{
						runner[i + 1] = true;
					}
				}
				runner[0] = true;
			}
			else if(str == "OUT")
			{
				outcount++;
				if(outcount == 3)
				{
					cout << point << endl;
					break;
				}
			}
			else if(str == "HOMERUN")
			{
				point++;
				for(int i = 0; i < 3; ++i)
				{
					if(runner[i])
					{
						point++;
						runner[i] = false;
					}
				}
			}
		}
	}
}

int main()
{
	solve();
	return(0);
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:15:17: error: 'memset' was not declared in this scope
   15 |                 memset(runner, 0, sizeof(bool) * 3);
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include<stdio.h>

main(){
	int c,y,t,o,p;
	char a[9];
	scanf("%d",&c);
	for(y=0;;y++){
		t=o=p=0;
		while(~scanf("%s",&a)||exit(1)){
			if(a[0]=='H')t++;
			else o++;
			if(a[1]=='O'){p+=t;t=0;}
			if(t>3){p++;t--;}
			if(o>2)break;
		}
		printf("%d\n",p);
	}
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:40: error: 'exit' was not declared in this scope
    9 |                 while(~scanf("%s",&a)||exit(1)){
      |                                        ^~~~
a.cc:2:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include<stdio.h>
  +++ |+#include <cstdlib>
    2 |
Language: C++

b,s,o;main(a){for(scanf("%*d");~scanf("%s",&a);b=a%3?(a%3-2)?b+1:o?b:(s=!printf("%d\n",s+((b>3)?b-3:0))):!(s+=++b))a%3-2||(o=(o+1)%3);}

Compiler output:
a.cc:1:1: error: 'b' does not name a type
    1 | b,s,o;main(a){for(scanf("%*d");~scanf("%s",&a);b=a%3?(a%3-2)?b+1:o?b:(s=!printf("%d\n",s+((b>3)?b-3:0))):!(s+=++b))a%3-2||(o=(o+1)%3);}
      | ^
a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
    1 | b,s,o;main(a){for(scanf("%*d");~scanf("%s",&a);b=a%3?(a%3-2)?b+1:o?b:(s=!printf("%d\n",s+((b>3)?b-3:0))):!(s+=++b))a%3-2||(o=(o+1)%3);}
      |           ^
Language: C++

#include<stdio.h>

int main(){
	int c,y,t,o,p;
	char a[9];
	read(0,c,4);
	for(y=0;;y++){
		for(t=o=p=0;;){
			if(!~scanf("%s",a))return 0;
			if(a[0]=='H')t++;
			else o++;
			if(a[1]=='O'){p+=t;t=0;}
			if(t>3){p++;t--;}
			if(o>2)break;
		}
		printf("%d\n",p);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'read' was not declared in this scope; did you mean 'fread'?
    6 |         read(0,c,4);
      |         ^~~~
      |         fread
Language: C++

main(){
	int c,y,t,o,p;
	char a[9];
	scanf("%d",&c);
	for(y=0;y<c;y++){
		for(t=o=p=0;;){
			if(!~scanf("%s",a))return 0;
			if(a[0]=='H')t++;
			else o++;
			if(a[1]=='O'){p+=t;t=0;}
			if(t>3){p++;t--;}
			if(o>2)break;
		}
		printf("%d\n",p);
	}c=1;
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf' was not declared in this scope
    4 |         scanf("%d",&c);
      |         ^~~~~
a.cc:14:17: error: 'printf' was not declared in this scope
   14 |                 printf("%d\n",p);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){
Language: C++

main(){
	int c,y,t,o,p;
	char a[9];
	scanf("%d",&c);
	for(y=0;y<c;y++){
		for(t=o=p=0;;){
			scanf("%s",a);
			if(a[0]=='H')t++;
			else o++;
			if(a[1]=='O'){p+=t;t=0;}
			if(t>3){p++;t--;}
			if(o>2)break;
		}
		printf("%d\n",p);
	}c=1;
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf' was not declared in this scope
    4 |         scanf("%d",&c);
      |         ^~~~~
a.cc:14:17: error: 'printf' was not declared in this scope
   14 |                 printf("%d\n",p);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){
Language: C++

b,o,s;main(a){for(scanf("%d");~scanf("%s",&a);)
        {
                if(a%3){
                        if(a&1,++o){
                                if(o%3){
                                        b=!printf("%d\n",s+b>3?b-3:0),s=0;
                                }
                        }
                        else{
                                b++;
                        }
                }
                else{
                        s+=b,b=0;
                }
        }
}

Compiler output:
a.cc:1:1: error: 'b' does not name a type
    1 | b,o,s;main(a){for(scanf("%d");~scanf("%s",&a);)
      | ^
a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
    1 | b,o,s;main(a){for(scanf("%d");~scanf("%s",&a);)
      |           ^
Language: C++

b,o,s;main(a){for(scanf("%d");~scanf("%s",&a);)a%3?a&1?++o%3?:(s=!printf("%d\n",b>3?s+b-3:s),b=0):b++:(s+=b+1,b=0);}

Compiler output:
a.cc:1:1: error: 'b' does not name a type
    1 | b,o,s;main(a){for(scanf("%d");~scanf("%s",&a);)a%3?a&1?++o%3?:(s=!printf("%d\n",b>3?s+b-3:s),b=0):b++:(s+=b+1,b=0);}
      | ^
a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
    1 | b,o,s;main(a){for(scanf("%d");~scanf("%s",&a);)a%3?a&1?++o%3?:(s=!printf("%d\n",b>3?s+b-3:s),b=0):b++:(s+=b+1,b=0);}
      |           ^
Language: C++

b,o,s;main(a){for(scanf("%d");~scanf("%s",&a);)b=a%3?a&1?++o%3?b:(s=!printf("%d\n",b>3?s+b-3:s)):b+1:(s+=b+1);}

Compiler output:
a.cc:1:1: error: 'b' does not name a type
    1 | b,o,s;main(a){for(scanf("%d");~scanf("%s",&a);)b=a%3?a&1?++o%3?b:(s=!printf("%d\n",b>3?s+b-3:s)):b+1:(s+=b+1);}
      | ^
a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
    1 | b,o,s;main(a){for(scanf("%d");~scanf("%s",&a);)b=a%3?a&1?++o%3?b:(s=!printf("%d\n",b>3?s+b-3:s)):b+1:(s+=b+1);}
      |           ^
Language: C++

#include<stdio.h>

int main(void){

	int i,j,k,q,p,inning,point,kazu[20];
	char eve[10];
	
		point=0;
		j=0;
		k=0;
		q=0;
		p=0;	
	
		scanf("%d",&inning);
		
		for(k=0;k<inning;k++){
		
			point=0;
			j=0;
			q=0;
			p=0;
			
		while(q<3){
		
			for(j=0;j<10;j++){
				eve[j]=0;
			}
			
			gets(eve);
			
			if(eve[0]=='O'){
				if(eve[1]=='U'){
					if(eve[2]=='T'){
						q++;
					}
				}		
			}
			if(eve[0]=='H'){
				if(eve[1]=='I'){
					if(eve[2]=='T'){
						p++;
						if(p>=4){
							point++;
						}
					}
				}
			}		
			
			if(eve[0]=='H'){
				if(eve[1]=='O'){
					if(eve[2]=='M'){
						if(eve[3]=='E'){
							if(eve[4]=='R'){
								if(eve[5]=='U'){
									if(eve[6]=='N'){
										point=point+p+1;
										p=0;
									}
								}
							}
						}		
					}
				}
			}
		}		
		kazu[k]=point;
	}
	for(k=0;k<inning;k++){
		printf("%d\n",kazu[k]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:25: error: 'gets' was not declared in this scope; did you mean 'getw'?
   29 |                         gets(eve);
      |                         ^~~~
      |                         getw
Language: C++

#include<iostram>
#include<cstdio>
#include<algorithm>
using namespace std;
main(){
int N;
scanf("%d",&N);
for(int i=;i<N;i++){
int oc=0;
int po=0;
int co[3]={0};

while(oc<3){
string str;
cin >> str;
if(str=="OUT") oc++;
if(str=="HIT"){
po+=co[2];
co[2]=co[1];
co[1]=co[0];
co[0]++;
}
if(str=="HOMERUN"){
po+=co[0]+co[1]+co[2]+1;
}
}
cout << po << endl;

}
}

Compiler output:
a.cc:1:9: fatal error: iostram: No such file or directory
    1 | #include<iostram>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<string>
using namespace std;

int loop;
int HIT,OUT,point;
string stait;
int main(){
  scanf("%d",&loop);
  for(int i=0;i<loop;i++){
    int base[4]={0};
    point = 0;
    OUT=0;
      while(OUT<3){
	cin>>stait;
	cout<<stait[1];
	if(stait[1]=="O"){
	  for(int j=1;j<4;j++)
	    if(base[j]==1){base[j]=0;point++;}
	  point++;
	}
	if(stait[1]=="U"){OUT++;}
	if(stait[1]=="I"){
	  if(base[3]==1){
	    point++;
	  }
	  for(int j=3;j>1;j--){
	    base[j]=base[j-1];
	    base[j-1]=0;
	  }
	}
      }
      printf("%d\n",point);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |         if(stait[1]=="O"){
a.cc:25:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |         if(stait[1]=="U"){OUT++;}
a.cc:26:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |         if(stait[1]=="I"){
Language: C++

#include <stdio.h>

int main(void){
	int dataset,ining;
	int i;
	int runner[3],point,out;
	char str[8];

	scanf("%d",&dataset);
	for(ining=0;ining<dataset;ining++){

		//init state variable
		for(i=0;i<3;i++){
			runner[i]=0;
		}
		point=0;
		out=0;

		//start	ining
		while(out<3){
			scanf("%s",&str[0]);

			if(strcmp(str,"HOMERUN")==0){
		                for(i=0;i<3;i++){
					point+=runner[i];
		                        runner[i]=0;
		                }
				point++;
			}

			else if(strcmp(str,"HIT")==0){
				if(runner[2]==1){
					runner[2]=0;
					point++;
				}
				if(runner[1]==1){
					runner[1]=0;
					runner[2]=1;
				}
				if(runner[0]==1){
					runner[0]=0;
					runner[1]=1;
				}
				runner[0]=1;
			}

			else if(strcmp(str,"OUT")==0){
				out++;
			}
			printf("POINT:%d OUT:%d\n",point,out);
		}

		//finish ining
		printf("%d\n",point);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:28: error: 'strcmp' was not declared in this scope
   23 |                         if(strcmp(str,"HOMERUN")==0){
      |                            ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 |
Language: C++

int main(){
  int n;
  string input;
  int out;
  cin >> n;
  for(int i = 0; i < n; i++)
  {
    first = second = third = out = point = 0;
    out = 0;
    while(out < 3)
    {
      cin >> input;
      if(input == "OUT")
      {
        out++;
        continue;
      }
      else if(input == "HIT")
      {
        point += third;
        third = second;
        second = first;
        first = 1;
        continue;
      }
      else if(input == "HOMERUN")
      {
        point += first + second + third + 1;
        first = second = third = 0;
        continue;
      }
    }
    cout << point << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string input;
      |   ^~~~~~
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n;
      |   ^~~
a.cc:8:5: error: 'first' was not declared in this scope
    8 |     first = second = third = out = point = 0;
      |     ^~~~~
a.cc:8:13: error: 'second' was not declared in this scope
    8 |     first = second = third = out = point = 0;
      |             ^~~~~~
a.cc:8:22: error: 'third' was not declared in this scope
    8 |     first = second = third = out = point = 0;
      |                      ^~~~~
a.cc:8:36: error: 'point' was not declared in this scope; did you mean 'int'?
    8 |     first = second = third = out = point = 0;
      |                                    ^~~~~
      |                                    int
a.cc:12:14: error: 'input' was not declared in this scope; did you mean 'int'?
   12 |       cin >> input;
      |              ^~~~~
      |              int
a.cc:33:5: error: 'cout' was not declared in this scope; did you mean 'out'?
   33 |     cout << point << endl;
      |     ^~~~
      |     out
a.cc:33:22: error: 'endl' was not declared in this scope
   33 |     cout << point << endl;
      |                      ^~~~