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

#include <iostream>
#include <string>

using namespace std;

int main() {
    int score_taro = 0;
    int score_hanako = 0;

    string s_taro, s_hanako;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> s_taro >> s_hanako;
        if (s_taro > s_hanako) score_taro++;
        else if (s_taro < s_hanako) score_hanako++;
        else {score_taro+++; score_hanako++;}
    }
    cout << score_taro << ' ' << score_hanako << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: expected primary-expression before ';' token
   17 |         else {score_taro+++; score_hanako++;}
      |                            ^
Language: C++

#include <stdio.h>
#include <string.h>
#define rep(i, a) for(int i = 0; i < a; ++i)

int main(void) {
  char s[250], t[250];
  int n, i, j, a = 0, b = 0;
  scanf("%d", &n)
  rep(i, n) {
    scanf("%s %s", s, t);
    if(strcmp(s, t) > 0) a += 3;
    else if(!strcmp(s, t)) a++, b++;
    else b += 3;
  }
  printf("%d %d\n", a, b);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before 'for'
    8 |   scanf("%d", &n)
      |                  ^
      |                  ;
a.cc:3:44: error: expected ';' before ')' token
    3 | #define rep(i, a) for(int i = 0; i < a; ++i)
      |                                            ^
a.cc:9:3: note: in expansion of macro 'rep'
    9 |   rep(i, n) {
      |   ^~~
Language: C++

#include<iostream>
#include<cmath>
#include<string>

using namespace std;

struct GamePoints {
	int points;
};

int main() {
	
	GamePoints Taro, Hanako;
	int n;
	
	while( cin >> n) {
		
		string card_1, card_2;
		
		pos = 0;
		Taro.points = 0;
		Hanako.points = 0;
		
		for(int i=0;i<n;i++) {
			
			fo >> card_1 >> card_2;
			
			if( card_1[0] > card_2[0] )
			Taro.points +=3;
			
			else if( card_1[0] < card_2[0] )
			Hanako.points +=3;
			
			else if (card_1[0] == card_2[0] && card_1.length() == 1  && 
			card_1.length() < card_2.length())
			Hanako.points +=3;
			
			else if( card_1[0] == card_2[0] ){
			
			if( card_1 == card_2 ) {
			Taro.points++;
			Hanako.points++;
		}
		
			else {
			for(int i=1;i<min(card_1.length(),card_2.length());i++)
			if ( card_1[i] < card_2[i] ) {
				Hanako.points += 3;
				break;
			}
			else if ( card_1[i] > card_2[i] ) {
			Taro.points += 3;	
			break;
			
		}		
		}	
		}
		else
		Hanako.points += 3;
		
		}
		cout << Taro.points << " " << Hanako.points << "\n";
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'pos' was not declared in this scope; did you mean 'pow'?
   20 |                 pos = 0;
      |                 ^~~
      |                 pow
a.cc:26:25: error: 'fo' was not declared in this scope
   26 |                         fo >> card_1 >> card_2;
      |                         ^~
Language: C++

#includ<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    int tarous=0,hanakos=0;
    for(int i=0;i<n;i++){
        string tarou,hanako;
        cin>>tarou>>hanako;
        if(tarou>hanako){
            tarous+=3;
        }else if(tarou<hanako){
            hanakos+=3;
        }else{
            tarous++;
            hanakos++;
        }
    }
    cout<<tarous<<' '<<hanakos<<endl;
    return 0;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #includ; did you mean #include?
    1 | #includ<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #includ<bits/stdc++.h>
a.cc:9:9: error: 'string' was not declared in this scope
    9 |         string tarou,hanako;
      |         ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #includ<bits/stdc++.h>
a.cc:10:14: error: 'tarou' was not declared in this scope; did you mean 'tarous'?
   10 |         cin>>tarou>>hanako;
      |              ^~~~~
      |              tarous
a.cc:10:21: error: 'hanako' was not declared in this scope; did you mean 'hanakos'?
   10 |         cin>>tarou>>hanako;
      |                     ^~~~~~
      |                     hanakos
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout<<tarous<<' '<<hanakos<<endl;
      |     ^~~~
a.cc:20:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:33: error: 'endl' was not declared in this scope
   20 |     cout<<tarous<<' '<<hanakos<<endl;
      |                                 ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #includ<bits/stdc++.h>
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
 int n;
 cin>>n;
 int tarous=0,hanakos=0;
 for(int i=0;i<n;i++){
 string tarou,hanako;
 cin>>tarou>>hanako;
 if(tarou>hanako){
 tarous+=3;
 }else if(tarou<hanako){
 hanakos+=3;
 }else{
 tarous++;
 hanakos++;
 }
}
 cout<<tarous<<" "hanakos<<endl;
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: unable to find string literal operator 'operator""hanakos' with 'const char [2]', 'long unsigned int' arguments
   20 |  cout<<tarous<<" "hanakos<<endl;
      |                ^~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<utility>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,m,n) for(ll i=m;i<n;i++)
#define REPR(i,n) for(ll i=n-1;i>=0;i--)
#define FORR(i,n,m) for(ll i=n-1;i>=m;i--)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K

int main(){
	ll n;
	ll ans1 = 0,ans2 = 0;
	REP(i,n){
		string s1,s2;
		cin >> s1 >> s2;
		if(s1.size()==s2.size()){
			ans1++;
			ans2++;
		}else if(s1.size()>s2.size){
			ans1 += 3;
		}else{
			ans2 += 3;
		}
	}
	cout << ans1 << ans2;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:39: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   30 |                 }else if(s1.size()>s2.size){
      |                                    ~~~^~~~
      |                                           ()
Language: C++

import java.util.Scanner;
public class Maic{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int scoa1=0,scoa2=0;
        String data[] = new String[2];

        int n=sc.nextInt();
        for(int i=0;i<n;i++){
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        }
        System.out.println(scoa2+" "+scoa1);
        sc.close();
    }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Maic{
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[])
{
    int lines;
    int Taro=0;
    int Hanako=0;
    string taro, hanako;
    cin >> lines;
    for (int i = 0; i < lines; i++)
    {
        cin >> taro >> hanako;
        if((int)taro[0] > (int)hanako[0])
        {
            Taro+=3;
        }else((int)taro[0] < (int)hanako[0])
        {
            Hanako+=3;
        }else
        {
            Taro+=1;
            Hanako+=1;
        }
    }

    return 0;
}



Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:16:45: error: expected ';' before '{' token
   16 |         }else((int)taro[0] < (int)hanako[0])
      |                                             ^
      |                                             ;
   17 |         {
      |         ~                                    
a.cc:19:10: error: 'else' without a previous 'if'
   19 |         }else
      |          ^~~~
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main(){
  int n, x = 0, y = 0;
  cin >> n;
  for(int i = 0; i < n; i++){
    string a,b;
    cin >> a >> b;
    if(a > b){
      x = x + 3;
    }else if(a < b){
      y = y + 3;
    }else{
      x = x + 1;
      y = y + 1;
    }
  }
  cout << x << " " << y << endl;
  return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:22:12: error: expected '}' at end of input
   22 |   return 0;
      |            ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

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

int main()
{
	int n;
	cin >> n;

	int taro_c = 0, hanako_c = 0;
	int taro_p = 0, hanako_p = 0;

	for (int i = 0; i < n; i++)
	{
		string taro, hanako;
		cin >> taro >> hanako;

		taro_c = taro[0];
		hanako_c = hanako[0];

		if (taro_c > hanako_c) taro_p += 3;
		else if (taro_c < hanako_c) hanako_p += 3;
		else
		{
			taro_p += 1;
			hanako_p += 1;
		}
	}
	cout << taro_p << " " << hanako_p <<　endl;
}


Compiler output:
a.cc:29:45: error: extended character 　 is not valid in an identifier
   29 |         cout << taro_p << " " << hanako_p <<　endl;
      |                                             ^
a.cc: In function 'int main()':
a.cc:29:45: error: '\U00003000endl' was not declared in this scope
   29 |         cout << taro_p << " " << hanako_p <<　endl;
      |                                             ^~~~~~
Language: C++

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

int main()
{
	string t, h;
        int n, tp = 0, hp = 0;

        cin >> n;

        while (n-- && cin >> t >> h) {
            int i = 0;
            for (int m = min(t.size(), h.size()); i < m && t[i] == h[i]; i++)
                ;
            if (t[i] == h[i])
                tp++, hp++;
            else if (t[i] > h[i])
                tp += 3;
            else
                hp += 3;
        }

        cout << tp << " " << hp << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope
   10 |         cin >> n;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:24:9: error: 'cout' was not declared in this scope
   24 |         cout << tp << " " << hp << endl;
      |         ^~~~
a.cc:24:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:36: error: 'endl' was not declared in this scope
   24 |         cout << tp << " " << hp << endl;
      |                                    ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <algorithm>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

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

int main()
{
    string t, h;
    int n, tp = 0, hp = 0;

    cin >> n;

    while (n-- && cin >> t >> h) {
        int i = 0;
        for (;t[i] && h[i] && t[i] == h[i]; i++)
            ;
        if (t[i] == h[i])
            tp++, hp++;
        else if (t[i] > h[i])
            tp += 3;
        else
            hp += 3;
    }

    cout << tp << " " << hp << endl;

    return 0;
}



Compiler output:
a.cc:4:2: error: stray '#' in program
    4 | u#include <iostream>
      |  ^
a.cc:4:1: error: 'u' does not name a type
    4 | u#include <iostream>
      | ^
a.cc: In function 'int main()':
a.cc:11:5: error: 'string' was not declared in this scope
   11 |     string t, h;
      |     ^~~~~~
a.cc:11:5: 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:14:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   14 |     cin >> n;
      |     ^~~
      |     std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:16:26: error: 't' was not declared in this scope; did you mean 'tp'?
   16 |     while (n-- && cin >> t >> h) {
      |                          ^
      |                          tp
a.cc:16:31: error: 'h' was not declared in this scope; did you mean 'hp'?
   16 |     while (n-- && cin >> t >> h) {
      |                               ^
      |                               hp
a.cc:28:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   28 |     cout << tp << " " << hp << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:28:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   28 |     cout << tp << " " << hp << endl;
      |                                ^~~~
      |                                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int tatous=0,hanakos=0;
    for(int i=0;i<n;i++){
        string tarou,hanako;
        cin>>tarou>>hanako;
        if(tarou>hanako){
            tarou+=3;
        }else if(tarou<hanako){
            hanako+=3;
        }else{
            tarous++;
            hanakos++;
        }
    }
    cout<<tarous<<' '<<hanakos<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'tarous' was not declared in this scope; did you mean 'tarou'?
   15 |             tarous++;
      |             ^~~~~~
      |             tarou
a.cc:19:11: error: 'tarous' was not declared in this scope; did you mean 'tatous'?
   19 |     cout<<tarous<<' '<<hanakos<<endl;
      |           ^~~~~~
      |           tatous
Language: C++

include<stdio.h>
#include<string.h>
int main(){
int n,i,taro=0,hanako=0;
char card1[101],card2[101];
scanf("%d",&n);
for(i=0;i<n;i++){
 scanf("%s %s",card1,card2);
 if(strcmp(card1,card2)==0) taro+=1,hanako+=1;
 else if(strcmp(card1,card2)>0) taro+=3;
 else if(strcmp(card1,card2)<0) hanako+=3;
}
printf("%d %d\n",taro,hanako);
return 0; }


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:1: error: 'scanf' was not declared in this scope
    6 | scanf("%d",&n);
      | ^~~~~
a.cc:9:5: error: 'strcmp' was not declared in this scope
    9 |  if(strcmp(card1,card2)==0) taro+=1,hanako+=1;
      |     ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<string.h>
  +++ |+#include <cstring>
    3 | int main(){
a.cc:13:1: error: 'printf' was not declared in this scope
   13 | printf("%d %d\n",taro,hanako);
      | ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include<string.h>
  +++ |+#include <cstdio>
    3 | int main(){
Language: C++

#include<iostream>

using namespace std;

int main(){




int n;
string tcard;
string hcard;
int tsum=0;
int hsum=0;

cin>>n;
for(int i=0;i<n;i++){
cin>>tcard>>hcard;
if(strcmp(tcard,hcard)>0)tsum += 3;
else if(strcmp(tcard,hcard)<0)hsum += 3;
else tsum += 1,hsum += 1;
}

cout<<tsum<<hsum<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:4: error: 'strcmp' was not declared in this scope
   19 | if(strcmp(tcard,hcard)>0)tsum += 3;
      |    ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

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

int main(){




int n;
string tcard;
string hcard;
int tsum=0;
int hsum=0;

cin>>n;
for(int i=0;i<n;i++){
cin>>tcard>>hcard;
if(strcmp(tcard,hcard)>0)tsum += 3;
else if(strcmp(tcard,hcard)<0)hsum += 3;
else tsum += 1,hsum += 1;
}

cout<<tsum<<hsum<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:4: error: 'strcmp' was not declared in this scope
   19 | if(strcmp(tcard,hcard)>0)tsum += 3;
      |    ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
Language: C++

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

int main(){




int n;
string tcard;
string hcard;
int tsum=0;
int hsum=0;

cin>>n;
for(int i=0;i<n;i++){
cin>>tcard>>hcard;
if(strcmp(tcard,hcard)>0)tsum += 3;
else if(strcmp(tcard,hcard)<0)hsum += 3;
else tsum += 1,hsum += 1;
}

cout<<tsum<<hsum<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   19 | if(strcmp(tcard,hcard)>0)tsum += 3;
      |           ^~~~~
      |           |
      |           std::string {aka std::__cxx11::basic_string<char>}
In file included from a.cc:2:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:20:16: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   20 | else if(strcmp(tcard,hcard)<0)hsum += 3;
      |                ^~~~~
      |                |
      |                std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C++

#include<iostream>
#include<string>
#define MAX 100
using namespace std ;
 
int main()
{
    int n;
    int t=0,h=0,x=0;
    char tarou[MAX], hanako[MAX];
     
    cin >> n ;
     
    for(;n>0;n--)
	{     
        cin >> tarou >> hanako;

		x = strcmp(tarou,hanako);
         
        if(x>0){
            t+=3;
        }
         
        if(x==0){
            t++;
            h++;
        }
         
        if(x<0){
            h+=3;
        }
    }    
     
    cout << t << ' ' << h << endl ;
     
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: 'strcmp' was not declared in this scope
   18 |                 x = strcmp(tarou,hanako);
      |                     ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
Language: C++

#include <iostream>
using namespace std;

int duel() {

	int n, p1 = 0, p2 = 0, duel;
	string c1, c2;

	for (int i = 0; i < n; ++i) {
		cin >> c1 >> c2;
		duel = c1.compare(c2);
		if (duel > 0) {
			p1 += 3;
		} else if (duel > 0) {
			p2 += 3;
		} else {
			p1++;
			p2++;
		}
	}
	cout << p1 << " " << p2 << endl;

	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

int itp1_9c(void)
{
	int n, sc1=0,sc2=0;
	string card1,card2;
	cin>>n;
	for (;n--;){
		cin>>card1>>card2;
		if (card1>card2){
			sc1+=3;
		}else if (card2>card1){
			sc2+=3;
		}else if (card1==card2){
			sc1++;
			sc2++;
		}
	}
	cout<<sc1<<" "<<sc2<<endl;
	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int itp1_9c(void)
{
	int n, sc1=0,sc2=0;
	string card1,card2;
	cin>>n;
	for (;n--;){
		cin>>card1>>card2;
		if (card1>card2){
			sc1+=3;
		}else if (card2>card1){
			sc2+=3;
		}else if (card1==card2){
			sc1++;
			sc2++;
		}
	}
	cout<<sc1<<" "<<sc2<<endl;
	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
int a,t=0,h=0,lt,lh,tt,hh,l;
cin >> a;
string taro,hana;
for(int i=0; i<a; ++i){
cin >> taro >> hana;
lt= taro.length();
lh= hana.length();
if(lt>lh){
l=lt;
}
else{
l=lh;
}
tt=0;
hh=0;
for(int j=0; j<l; j++){
tt=tt+taro[j]*(10**(2*(l-j)));
hh=hh+hana[j]*(10**(2*(l-j)));
}
if(tt>hh){
t=t+3;
}
else if(hh>tt){
h=h+3
}
else if(hh=tt){
h=h+1
t=t+1
}
}
cout<<tt<<" "<<hh<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: invalid type argument of unary '*' (have 'int')
   23 | tt=tt+taro[j]*(10**(2*(l-j)));
      |                   ^~~~~~~~~~
a.cc:24:19: error: invalid type argument of unary '*' (have 'int')
   24 | hh=hh+hana[j]*(10**(2*(l-j)));
      |                   ^~~~~~~~~~
a.cc:30:6: error: expected ';' before '}' token
   30 | h=h+3
      |      ^
      |      ;
   31 | }
      | ~     
a.cc:33:6: error: expected ';' before 't'
   33 | h=h+1
      |      ^
      |      ;
   34 | t=t+1
      | ~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
int a,t=0,h=0,lt,lh,tt,hh,l;
cin >> a;
string taro,hana;
for(int i=0; i<a; ++i){
cin >> taro >> hana;
lt= taro.length();
lh= hana.length();
if(lt>lh){
l=lt;
}
else{
l=lh;
}
tt=0;
hh=0;
for(int j=0; j<lt; j++){
tt=tt+taro[j]*(10**(2*(l-j)));
}
for(int k=0; k<lh; k++){
hh=hh+hana[k]*(10**(2*(l-k)));
}
if(tt>hh){
t=t+3;
}
else if(hh>tt){
h=h+3
}
else if(hh=tt){
h=h+1
t=t+1
}
}
cout<<tt<<" "<<hh<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: invalid type argument of unary '*' (have 'int')
   23 | tt=tt+taro[j]*(10**(2*(l-j)));
      |                   ^~~~~~~~~~
a.cc:26:19: error: invalid type argument of unary '*' (have 'int')
   26 | hh=hh+hana[k]*(10**(2*(l-k)));
      |                   ^~~~~~~~~~
a.cc:32:6: error: expected ';' before '}' token
   32 | h=h+3
      |      ^
      |      ;
   33 | }
      | ~     
a.cc:35:6: error: expected ';' before 't'
   35 | h=h+1
      |      ^
      |      ;
   36 | t=t+1
      | ~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
int a,t=0,h=0,lt,lh,tt,hh,l;
cin >> a;
string taro,hana;
for(int i=0; i<a; ++i){
cin >> taro >> hana;
lt= taro.length();
lh= hana.length();
if(lt>lh){
l=lt;
}
else{
l=lh;
}
tt=0;
hh=0;
for(int j=0; j<lt; j++){
tt=tt+taro[j]*(10**(2*(l-j)));
}
for(int k=0; k<lh; k++){
hh=hh+hana[k]*(10**(2*(l-k)));
}
if(tt>hh){
t=t+3;
}
else if(hh>tt){
h=h+3;
}
else if(hh=tt){
h=h+1;
t=t+1;
}
}
cout<<tt<<" "<<hh<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: invalid type argument of unary '*' (have 'int')
   23 | tt=tt+taro[j]*(10**(2*(l-j)));
      |                   ^~~~~~~~~~
a.cc:26:19: error: invalid type argument of unary '*' (have 'int')
   26 | hh=hh+hana[k]*(10**(2*(l-k)));
      |                   ^~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <math.h>

using namespace std;

int main(){
int a,t=0,h=0,lt,lh,tt,hh,l;
cin >> a;
string taro,hana;
for(int i=0; i<a; ++i){
cin >> taro >> hana;
lt= taro.length();
lh= hana.length();
if(lt>lh){
l=lt;
}
else{
l=lh;
}
tt=0;
hh=0;
for(int j=0; j<lt; j++){
tt=tt+taro[j]*(pow(10,(2*(l-j)));
}
for(int k=0; k<lh; k++){
hh=hh+hana[k]*(pow(10,(2*(l-k)));
}
if(tt>hh){
t=t+3;
}
else if(hh>tt){
h=h+3
}
else if(hh=tt){
h=h+1
t=t+1
}
}
cout<<tt<<" "<<hh<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:33: error: expected ')' before ';' token
   24 | tt=tt+taro[j]*(pow(10,(2*(l-j)));
      |               ~                 ^
      |                                 )
a.cc:27:33: error: expected ')' before ';' token
   27 | hh=hh+hana[k]*(pow(10,(2*(l-k)));
      |               ~                 ^
      |                                 )
a.cc:33:6: error: expected ';' before '}' token
   33 | h=h+3
      |      ^
      |      ;
   34 | }
      | ~     
a.cc:36:6: error: expected ';' before 't'
   36 | h=h+1
      |      ^
      |      ;
   37 | t=t+1
      | ~
Language: C++

#include <iostream>
#include <string>
#include <math.h>

using namespace std;

int main(){
int a,t=0,h=0,lt,lh,tt,hh,l;
cin >> a;
string taro,hana;
for(int i=0; i<a; ++i){
cin >> taro >> hana;
lt= taro.length();
lh= hana.length();
if(lt>lh){
l=lt;
}
else{
l=lh;
}
tt=0;
hh=0;
for(int j=0; j<lt; j++){
tt=tt+taro[j]*(pow(10,(2*(l-j))));
}
for(int k=0; k<lh; k++){
hh=hh+hana[k]*(pow(10,(2*(l-k))));
}
if(tt>hh){
t=t+3;
}
else if(hh>tt){
h=h+3
}
else if(hh=tt){
h=h+1
t=t+1
}
}
cout<<tt<<" "<<hh<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:6: error: expected ';' before '}' token
   33 | h=h+3
      |      ^
      |      ;
   34 | }
      | ~     
a.cc:36:6: error: expected ';' before 't'
   36 | h=h+1
      |      ^
      |      ;
   37 | t=t+1
      | ~
Language: C++

#include <iostream>
#include <string>
#include <math.h>

using namespace std;

int main(){
int a,t=0,h=0,lt,lh,tt,hh,l;
cin >> a;
string taro,hana;
for(int i=0; i<a; ++i){
cin >> taro >> hana;
lt= taro.length();
lh= hana.length();
if(lt>lh){
l=lt;
}
else{
l=lh;
}
tt=0;
hh=0;
for(int j=0; j<lt; j++){
tt=tt+taro[j]*(pow(10,(2*(l-j))));
}
for(int k=0; k<lh; k++){
hh=hh+hana[k]*(pow(10,(2*(l-k))));
}
if(tt>hh){
t=t+3;
}
else if(hh>tt){
h=h+3
}
else if(hh==tt){
h=h+1
t=t+1
}
}
cout<<tt<<" "<<hh<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:6: error: expected ';' before '}' token
   33 | h=h+3
      |      ^
      |      ;
   34 | }
      | ~     
a.cc:36:6: error: expected ';' before 't'
   36 | h=h+1
      |      ^
      |      ;
   37 | t=t+1
      | ~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){

iint i,n,t,h;
string tc,hc;

cin>>n;

for(i=0; i<n; i++){

cin>>tc>>hc;

if(tc<hc)t++;
else if(tc>hc)h++;
else{
tc++;
hc++;
}

}

cout<<t<<" "<<h<<"\n";

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'iint' was not declared in this scope; did you mean 'uint'?
    6 | iint i,n,t,h;
      | ^~~~
      | uint
a.cc:9:6: error: 'n' was not declared in this scope
    9 | cin>>n;
      |      ^
a.cc:11:5: error: 'i' was not declared in this scope
   11 | for(i=0; i<n; i++){
      |     ^
a.cc:15:10: error: 't' was not declared in this scope; did you mean 'tc'?
   15 | if(tc<hc)t++;
      |          ^
      |          tc
a.cc:16:15: error: 'h' was not declared in this scope; did you mean 'hc'?
   16 | else if(tc>hc)h++;
      |               ^
      |               hc
a.cc:18:3: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   18 | tc++;
      | ~~^~
a.cc:19:3: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   19 | hc++;
      | ~~^~
a.cc:24:7: error: 't' was not declared in this scope; did you mean 'tc'?
   24 | cout<<t<<" "<<h<<"\n";
      |       ^
      |       tc
a.cc:24:15: error: 'h' was not declared in this scope; did you mean 'hc'?
   24 | cout<<t<<" "<<h<<"\n";
      |               ^
      |               hc
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){

int i,n,t,h;
string tc,hc;

cin>>n;

for(i=0; i<n; i++){

cin>>tc>>hc;

if(tc<hc)t++;
else if(tc>hc)h++;
else{
tc++;
hc++;
}

}

cout<<t<<" "<<h<<"\n";

}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   18 | tc++;
      | ~~^~
a.cc:19:3: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   19 | hc++;
      | ~~^~
Language: Java

import java.util.*;

public class j19d{
  public static void main(String args[]) {
    Scanner in  = new Scanner(System.in);
    String str  = in.next();
    int rnum    = in.nextInt();
    String pstr;


    for(int i = 0; i < rnum; i++){
      pstr = "";
      String order = in.next();
      int start    = in.nextInt();
      int end      = in.nextInt();
      if(order.equals("print")){
        pstr = str.substring(start,end+1);
        System.out.println(pstr);
      } else if(order.equals("reverse")){
        pstr = str.substring(start+1,end+1);
        StringBuffer sb = new StringBuffer(pstr);
        sb = sb.reverse();
        pstr = str.substring(0,start);
        pstr += sb.toString();
        pstr += str.substring(end,str.length());
        //tstr.reverse();
      } else if(order.equals("replace")){

      }
    }
  }
}
xyz
2
reverse 0 2
print 0 2

xyz
k17118kk:AOJ k17118kk$ java j19d
abcd
2
reverse 1 2
print 0 3



Compiler output:
Main.java:33: error: class, interface, enum, or record expected
xyz
^
1 error
Language: Java

// ITP1_9_D Transformation
import java.io.*;

class Main {

   static String str;

   public static void main(String args[]) {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

      try {
         str = br.readLine();
         int q = Integer.parseInt(br.readLine());
         for (int i = 0; i < q; i++) {
            String[] inst = br.readLine().split(" ");
            int a = Integer.parseInt(inst[1]);
            int b = Integer.parseInt(inst[2]);
            if (inst[0].equals("print"))  print(a, b);
            else if (inst[0].equals("reverse")) reverse(a, b);
            else if (inst[0].equals("replace")) replace(a, b, inst[3]);
         }
      }

      catch (Exception e) {
         System.err.println(e);
      }
   }

   static void print(int a, int b) {
      System.out.println(str.substring(a, b + 1));
   }

   static void reverse(int a, int b) {
      str = str.substring(0, a) + new StringBuffer(str.substring(a, b + 1)).REVERse().toString() + str.substring(b + 1, str.length());
   }

   static void replace(int a, int b, String p) {
      str = str.replaceAll(str.substring(a, b + 1), p); 
   }
}

Compiler output:
Main.java:34: error: cannot find symbol
      str = str.substring(0, a) + new StringBuffer(str.substring(a, b + 1)).REVERse().toString() + str.substring(b + 1, str.length());
                                                                           ^
  symbol:   method REVERse()
  location: class StringBuffer
1 error
Language: Java

import java.util.*;
import java.util.regex.Matcher;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        StringBuffer str = new StringBuffer(scan.next());
        int q = scan.nextInt();

        for (int i = 0; i < q; i++) {
            String order = scan.next();
            int a = scan.nextInt(), b = scan.nextInt() + 1;
            System.out.printf("%d %d \n", a, b);
            switch (order) {
                case "replace":
                    String p = scan.next();
                    str = str.replace(a, b, p);
                    break;
                case "reverse":
                    StringBuffer tmpStr = new StringBuffer(str.substring(a, b)).reverse();
                    str = str.replace(a, b, tmpStr.toString());
                    break;
                case "print":
                    System.out.println(str.substring(a, b));
                    break;
            }
        }

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

import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		String str = scan.next();
		String strB = str;
		int q = scan.nextInt();
		for(int i = 0; i < q; i++){
			String com = scan.next();
			if(com.equals("print")){
				int a = scan.nextInt();
				int b = scan.nextInt();
				String output = strB.substring(a, b + 1);
			} else if(com.equals("reverse")){
				int a = scan.nextInt();
				int b = scan.nextInt();
				int len = strB.length();
				String s1 = strB.substring(0, a);
				String div = strB.substrin(a, b + 1);
				String s2 = strB.substring(b + 1);
				StringBuilder sb = new StringBuilder();
				for(int j = b; j >= a; j--){
					sb.append(div.charAt(i));
				}
				strB = s1 + sb + s2;
			} else if(com.equals("replace")){
				int a = scan.nextInt();
				int b = scan.nextInt();
				String p = scan.next();
				String s1 = strB.substring(0, a);
				String div = strB.substring(a, b + 1);
				String s2 = strB.substring(b + 1);
				String repl = div.replaceAll("[a-z]", p);
				strB = s1 + repl + s2;
			}
		}
	}
}

Compiler output:
Main.java:21: error: cannot find symbol
				String div = strB.substrin(a, b + 1);
				                 ^
  symbol:   method substrin(int,int)
  location: variable strB of type String
1 error
Language: Java

import java.util.*;

public class Main36{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		String str = scan.next();
		String s1, s2;
		int q = scan.nextInt();
		int len = str.length();
		for(int i = 0; i < q; i++){
			String com = scan.next();
			if(com.equals("print")){
				int a = scan.nextInt();
				int b = scan.nextInt();
				s1 = str.substring(a, b + 1);
				System.out.println(s1);
			}
			if(com.equals("reverse")){
				int a = scan.nextInt();
				int b = scan.nextInt();
				s1 = str.substring(0, a);
				s2 = str.substring(b + 1, len);
				StringBuffer sb = new StringBuffer();
				for(int j = b; j >= a; j--){
					sb.append(str.charAt(j));
				}
				str = s1 + sb + s2;
			}
			if(com.equals("replace")){
				int a = scan.nextInt();
				int b = scan.nextInt();
				String p = scan.next();
				s1 = str.substring(0, a);
				s2 = str.substring(b + 1);
				str = s1 + p + s2;
			}
		}
	}
}

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

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		String str = scan.next();
		int q = scan.nextInt();
		for(int i = 0; i < q; i++){
			String com = scan.next();
			int a = scan.nextInt();
			int b = scan.nextInt();
			if(com.equals("print")){
				String out = str.substring(a, b);
				System.out.println(out);
			} else if(com.equals("reverse")){
				StringBuffer sb = new StringBuffer();
				String s1 = str.substring(0, a);
				String div = str.substring(a, b + 1);
				String s2 = str.substrig(b + 1);
				for(int i = div.length() - 1; i >= 0; i--){
					char ch = div.charAt(i);
					sb.append(ch);
				}
				div = sb.toString();
				StringBuffer sb2 = new StringBuffer();
				sb2.append(s1).append(div).append(s2);
				str = sb2.toString();
				
			} else if(com.equals("replace")){
				String p = scan.next();
				String s1 = str.substring(0, a);
				String s2 = str.substring(b + 1);
				StringBuffer sb = new StringBuffer();
				sb.append(s1).append(p).append(s2);
				str = sb.toString();
			}
		}
	}
}

Compiler output:
Main.java:20: error: cannot find symbol
				String s2 = str.substrig(b + 1);
				               ^
  symbol:   method substrig(int)
  location: variable str of type String
Main.java:21: error: variable i is already defined in method main(String[])
				for(int i = div.length() - 1; i >= 0; i--){
				        ^
2 errors
Language: Java

import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		String str = scan.next();
		int q = scan.nextInt();
		for(int i = 0; i < q; i++){
			String com = scan.next();
			int a = scan.nextInt();
			int b = scan.nextInt();
			if(com.equals("print")){
				String out = str.substring(a, b + 1);
				System.out.println(out);
			}
			if(com.equals("reverse")){
				String s1 = str.substring(0, a);
				String s2 = str.substring(b + 1);
				StringBuffer sb = new StringBuffer();
				for(int j = b; j >= a; j--){
					char ch = str.charAt(i);
					sb.append(ch);
				}
				String r = sb.toString();
				StringBuffer sb2 = new StringBuffer();
				sb2.append(s1).append(r).append(s2);
				str = sb2.toString();
			}
			if(com.equals("replace")){
				String p = scan.next();
				String s1 = str.substring(0, a);
				String s2 = str.substring(b + 1);
				StringBuffer sb = new StringBuffer();
				sb.append(s1).append(p).append(s2);
				str = sb.toString()
			}
		}
	}
}

Compiler output:
Main.java:36: error: ';' expected
				str = sb.toString()
				                   ^
1 error
Language: Java

 public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	
    	String str = scan.nextLine();
    	char[] str_c = new char[str.length()];
    	int num = scan.nextInt();
    	
    	String meirei;
    	String change = "";
    	String find;
    	int begin;
    	int end;
    	
    	for(int i = 0; i < num; i++){
	    	meirei = scan.next();
	        begin = scan.nextInt();
	        end = scan.nextInt();
	    	
	    	String replace = "";
	    	String output = "";
	    	
	    	for(int k = 0; k < str.length(); k++){
	    		str_c[k] = str.charAt(k);
	    	}
	    	
	    	if(meirei.equals("replace")){
	    		replace = scan.next();
	    	}
	    	
	    	if(meirei.equals("print")){
	    		System.out.println(str.substring(begin, end + 1));
	    	}else if(meirei.equals("reverse")){
	    		find = str.substring(begin, end + 1);
	    		for(int j = find.length() - 1; j >= 0; j--){
	    			change += find.charAt(j);
	    		}
	    		for(int j = begin; j < end + 1; j++){
    				str_c[j] = change.charAt(j - begin);	
    			}
	    		str = String.valueOf(str_c);
	    	}else{
    			for(int j = begin; j < end + 1; j++){
    				str_c[j] = replace.charAt(j - begin);
    				
    			}
	    		str = String.valueOf(str_c);
	    	}
    	}
    	
     }

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
 public static void main(String[] args){
               ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		int v = Integer.parseInt(sc.nextLine());

		List<String> order = new ArrayList<String>();

		for (int i = 0; i < v; i++) {
			order.add(sc.nextLine());
		}

		for (String string : order) {
			String[] orders = string.split(" ");
			int v1 = Integer.parseInt(orders[1]);
			int v2 = Integer.parseInt(orders[2]);
			if (orders[0].equals("replace")) {
				StringBuffer sb = new StringBuffer(line.substring(v1, v2+1));
				sb.replace(0,v2-v1+1, orders[3]);
				line=line.replace(line.substring(v1, v2+1), sb);
			}
			if (orders[0].equals("reverse")) {
				StringBuffer sb = new StringBuffer(line.substring(v1, v2+1));
				sb.reverse();
				line=line.replace(line.substring(v1, v2+1), sb);
			}
			if (orders[0].equals("print")) {
				System.out.println(line.substring(v1, v2+1));
			}
		}
	}

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

import java.io.IOException;
import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		String str = scan.next();
		int orderNum = scan.nextInt();
		int a = 0;
		int b = 0;

		for (int i = 0; i < orderNum; i++){
			String order = scan.next();

			if (order.equals("print")){
				a = scan.nextInt();
				b = scan.nextInt();

				String printResult = str.substring(a, b + 1);
				System.out.println(printResult);
			}

			if (order.equals("reverse")){
				a = scan.nextInt();
				b = scan.nextInt();

				String strReverse = str.substring(a, b);
				char[] strChara = new char[strReverse.length()];

				for (i = 0; i < strChara.length;i++){
					char tmp = strChara[i];
					strChara[i] = strChara[i + 1];
					strChara[i + 1] = tmp;
				}
				str = strChara.toString();
			}

			if (order.equals("replace")){
				a = scan.nextInt();
				b = scan.nextInt();
				String strReplaceWord = scan.next();

				String strReplaceTarget = str.substring(a, b);
				String strReplace = strReplaceTarget.replace(strReplaceTarget, strReplaceWord);

				str = strReplace.concat(str);
			}
		}
		scan.close();
	}
}

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

mport java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int q = sc.nextInt();
        int cnt = 1;
        List<Character> str = new ArrayList<>();
        for(int i = 0; i < s.length(); i++){
            str.add(s.charAt(i));
        }
        while(cnt <= q){
            String order = sc.next();
            int a = sc.nextInt();
            int b = sc.nextInt();
            char k =0;
            char l = 0;
            int a2 = 0;
            int b2 = 0;
            if(order.equals("print")){
                for(int i = 0; i <= b - a; i++){
                    System.out.print(str.get(i + a));
                }
                System.out.println("");
            }else if(order.equals("reverse")){
                 a2 = a;
                    b2 = b;
                for(int i = 0; i < (b - a)/2; i++){
                   k = str.get(a2);
                   l = str.get(b2);
                           str.set(a2, l);
                           str.set(b2, k);
                           a2++;
                           b2--;
                }
            }else{
            String p = sc.next();
            a2 = a;
            for(int i = 0; i <= b - a; i++){
                str.set(a2, p.charAt(i));
                a2++;
            }
        }
            cnt++;
        }
    }}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.ArrayList;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.List;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.Scanner;
^
3 errors
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int q = sc.nextInt();
        int cnt = 1;
        char k = 0;
        char l = 0;
        int a2 = 0;
        int b2 = 0;
        List<Character> str = new ArrayList<>();
        for (int i = 0; i < s.length(); i++) {
            str.add(s.charAt(i));
        }
        while (cnt <= q) {
            String order = sc.next();
            int a = sc.nextInt();
            int b = sc.nextInt();
            a2 = a;
            b2 = b;
            switch (order) {
                case "print":
                    for (int i = 0; i <= b - a; i++) {
                        System.out.print(str.get(i + a));
                    }   System.out.println("");
                    break;
                case "reverse":
                    for (int i = 0; i < (b - a) / 2 + ((b - a) % 2); i++) {
                        k = str.get(a2);
                        l = str.get(b2);
                        str.set(a2, l);
                        str.set(b2, k);
                        a2++;
                        b2--;
                    }   break;
                default:
                    String p = sc.next();
                    for (int i = 0; i <= b - a; i++) {
                        str.set(a2, p.charAt(i));
                        a2++;
                    }   break;
            }
            cnt++;
        }
    }

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

import java.util.*;

class Main{
	public static void main(String[] args){
		
		Scanner sc =new Scanner(System.in);
		String str = sc.nextLine();
		int q = Integer.parseInt(sc.nextLine());
		for(int i=0;i<q;i++){
			String[] line=sc.nextLine().split(" ");
			int a=Integer.parseInt(line[1]);
			int b=Integer.parseInt(line[2]);
		//index	
			int index=0;
			if(line[0].equals("print")){
				index=1;
			}else if(line[0].equals("reverse")){
				index=2;
			}else if(line[0].equals("replace")){
				index=3;
			}
			switch(index){
				case 1:
					System.out.println(str.substring(a,b+1));
					break;
				case 2:
					StringBuffer sb = new StringBuffer();
					String[] strReverse = new String[b-a+1];
					for(int j=b;j>a-1;j--){
						sb.append(str.charAt(j));
					}
					String str1=str.substring(0,a);
					String str2=str.substring(b+1);
					str = str1+sb.toString()+str2;
					break;	
				case 3:
					String str3=str.substring(0,a);
					String str4=str.substring(b+1);
					str = str3+line[3]+str4;
					break;
			}
			System.out.println(i+":"+index+"*: "str);
		}
	}
}

Compiler output:
Main.java:42: error: ')' or ',' expected
			System.out.println(i+":"+index+"*: "str);
			                                    ^
Main.java:42: error: ';' expected
			System.out.println(i+":"+index+"*: "str);
			                                       ^
2 errors