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

using System;
class   ClassSD{

static void Main(){
while(true)
{
string a=Console.ReadLine();
if(a==null){break;}
int n=int.Parse(Console.ReadLine());
int []x=new int[n];
for(int i=0;i<n;i++){
x[i]=int.Parse(Console.ReadLine());

}
int sum=x.Sum()%a.Length;
Console.WriteLine(a.Substring(sum)+a.Substring(0,sum));


}
/////////////////////


}

}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:25:2: error: expected ';' after class definition
   25 | }
      |  ^
      |  ;
a.cc: In static member function 'static void ClassSD::Main()':
a.cc:7:1: error: 'string' was not declared in this scope
    7 | string a=Console.ReadLine();
      | ^~~~~~
a.cc:8:4: error: 'a' was not declared in this scope
    8 | if(a==null){break;}
      |    ^
a.cc:8:7: error: 'null' was not declared in this scope
    8 | if(a==null){break;}
      |       ^~~~
a.cc:9:7: error: expected primary-expression before 'int'
    9 | int n=int.Parse(Console.ReadLine());
      |       ^~~
a.cc:10:5: error: structured binding declaration cannot have type 'int'
   10 | int []x=new int[n];
      |     ^~
a.cc:10:5: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:10:5: error: empty structured binding declaration
a.cc:10:7: error: expected initializer before 'x'
   10 | int []x=new int[n];
      |       ^
a.cc:12:1: error: 'x' was not declared in this scope
   12 | x[i]=int.Parse(Console.ReadLine());
      | ^
a.cc:12:6: error: expected primary-expression before 'int'
   12 | x[i]=int.Parse(Console.ReadLine());
      |      ^~~
a.cc:15:9: error: 'x' was not declared in this scope
   15 | int sum=x.Sum()%a.Length;
      |         ^
a.cc:15:17: error: 'a' was not declared in this scope
   15 | int sum=x.Sum()%a.Length;
      |                 ^
a.cc:16:1: error: 'Console' was not declared in this scope
   16 | Console.WriteLine(a.Substring(sum)+a.Substring(0,sum));
      | ^~~~~~~
Language: C++

using System;
class   ClassSD{
 
static void Main(){
while(true)
{
string a=Console.ReadLine();
if(a==null){break;}
int n=int.Parse(Console.ReadLine());
int []x=new int[n];
for(int i=0;i<n;i++){
x[i]=int.Parse(Console.ReadLine());
 sums+=x[i];
}
int sum=sums%a.Length;
Console.WriteLine(a.Substring(sum)+a.Substring(0,sum));
 
 
}
/////////////////////
 
 
}
 
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:25:2: error: expected ';' after class definition
   25 | }
      |  ^
      |  ;
a.cc: In static member function 'static void ClassSD::Main()':
a.cc:7:1: error: 'string' was not declared in this scope
    7 | string a=Console.ReadLine();
      | ^~~~~~
a.cc:8:4: error: 'a' was not declared in this scope
    8 | if(a==null){break;}
      |    ^
a.cc:8:7: error: 'null' was not declared in this scope
    8 | if(a==null){break;}
      |       ^~~~
a.cc:9:7: error: expected primary-expression before 'int'
    9 | int n=int.Parse(Console.ReadLine());
      |       ^~~
a.cc:10:5: error: structured binding declaration cannot have type 'int'
   10 | int []x=new int[n];
      |     ^~
a.cc:10:5: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:10:5: error: empty structured binding declaration
a.cc:10:7: error: expected initializer before 'x'
   10 | int []x=new int[n];
      |       ^
a.cc:12:1: error: 'x' was not declared in this scope
   12 | x[i]=int.Parse(Console.ReadLine());
      | ^
a.cc:12:6: error: expected primary-expression before 'int'
   12 | x[i]=int.Parse(Console.ReadLine());
      |      ^~~
a.cc:13:2: error: 'sums' was not declared in this scope
   13 |  sums+=x[i];
      |  ^~~~
a.cc:15:9: error: 'sums' was not declared in this scope; did you mean 'sum'?
   15 | int sum=sums%a.Length;
      |         ^~~~
      |         sum
a.cc:15:14: error: 'a' was not declared in this scope
   15 | int sum=sums%a.Length;
      |              ^
a.cc:16:1: error: 'Console' was not declared in this scope
   16 | Console.WriteLine(a.Substring(sum)+a.Substring(0,sum));
      | ^~~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(void){
   
   int number;
   string str;


   while(1){

     cin >> str;
     if(str == "-") break;

     cin >> number;
     for(int i=0; i<number; i++){
        int move;
        string strC;
        cin >> move;
        
        strC = str.strsub(move);
        str.erase(move);
        str += strC;
     }

     cout << str << endl;
   }

   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'strsub'
   23 |         strC = str.strsub(move);
      |                    ^~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(void){
   
   int number;
   string str;


   while(1){

     cin >> str;
     if(str == "-") break;

     cin >> number;
     for(int i=0; i<number; i++){
        int move;
        string strC;
        cin >> move;
        
        strC = str.strsub(0,move);
        str.erase(move);
        str += strC;
     }

     cout << str << endl;
   }

   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'strsub'
   23 |         strC = str.strsub(0,move);
      |                    ^~~~~~
Language: C++

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

int main()[
 int h,mh;
 string m;

 while(1){
  cin >> m ;
  if(m=="-")break;
  cin >> h ;
  for(int i=0;i<h;i++){
   cin >> mh ;
   m=m.substr(mh+1,m.length())+m.substr(0,mh);
  }
  cout << m <<endl;
 }

 return 0;
}

Compiler output:
a.cc:6:2: error: expected primary-expression before 'int'
    6 |  int h,mh;
      |  ^~~
a.cc:5:12: error: expected ']' before 'int'
    5 | int main()[
      |            ^
      |            ]
    6 |  int h,mh;
      |  ~~~        
a.cc:9:2: error: expected unqualified-id before 'while'
    9 |  while(1){
      |  ^~~~~
a.cc:20:2: error: expected unqualified-id before 'return'
   20 |  return 0;
      |  ^~~~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

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

int main()[
 int h,mh;
 string m;

 while(1){
  cin >> m ;
  if(m=="-")break;
  cin >> h ;
  for(int i=0;i<h;i++){
   cin >> mh ;
   m=m.substr(mh+1)+m.substr(0,mh);
  }
  cout << m <<endl;
 }

 return 0;
}

Compiler output:
a.cc:6:2: error: expected primary-expression before 'int'
    6 |  int h,mh;
      |  ^~~
a.cc:5:12: error: expected ']' before 'int'
    5 | int main()[
      |            ^
      |            ]
    6 |  int h,mh;
      |  ~~~        
a.cc:9:2: error: expected unqualified-id before 'while'
    9 |  while(1){
      |  ^~~~~
a.cc:20:2: error: expected unqualified-id before 'return'
   20 |  return 0;
      |  ^~~~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

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

int main()[
 int h,mh;
 string m;

 while(1){
  cin >> m ;
  if(m=="-")break;
  cin >> h ;
  for(int i=0;i<h;i++){
   cin >> mh ;
   m=m.substr(mh)+m.substr(0,mh);
  }
  cout << m <<endl;
 }

 return 0;
}

Compiler output:
a.cc:6:2: error: expected primary-expression before 'int'
    6 |  int h,mh;
      |  ^~~
a.cc:5:12: error: expected ']' before 'int'
    5 | int main()[
      |            ^
      |            ]
    6 |  int h,mh;
      |  ~~~        
a.cc:9:2: error: expected unqualified-id before 'while'
    9 |  while(1){
      |  ^~~~~
a.cc:20:2: error: expected unqualified-id before 'return'
   20 |  return 0;
      |  ^~~~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <cctype>

typedef struct _ORDER {
    char data[201]; // max of string.
    int effect_count;
    int shuffle_number[100]; // max of shuffle number is 100.
} ORDER;

class Shuffle {
    std::vector<ORDER> lst;
    std::list<char> shuffle_data;

public:
    bool run(void); // execute shuffle operation.

private:
    void read(void);
    void shuffle(void);
    void disp();
};

bool Shuffle::run()
{
    read();
    if (0 >= lst.size()) {
        return false;
    }
    shuffle();
    return true;
}

void Shuffle::read(void)
{
    ORDER tmp;
    std::string line;
    while (true) {
        std::memset(&tmp, 0, sizeof(tmp));
        std::cin >> line;
        if (0 == std::strcmp("-", line.c_str())) {
            break;
        }
        memcpy(tmp.data, line.c_str(), sizeof(tmp.data));
        std::cin >> tmp.effect_count;
        for (int i = 0; i < tmp.effect_count; i++) {
            std::cin >> tmp.shuffle_number[i];
        }
        lst.push_back(tmp);
    }
}

void Shuffle::shuffle()
{
    for (std::vector<ORDER>::const_iterator it = lst.begin(); it != lst.end(); it++) {
        int index = 0;
        shuffle_data.clear();
        while ('\0' != it->data[index]) {
            shuffle_data.push_back(it->data[index++]);
        }
        for (int i = 0; i < it->effect_count; i++) {
            for (int j = 0; j < it->shuffle_number[i]; j++) {
                char t = shuffle_data.front();
                shuffle_data.pop_front();
                shuffle_data.push_back(t);
            }
        }
        disp();
    }
}

void Shuffle::disp()
{
    for (std::list<char>::const_iterator it = shuffle_data.begin(); it != shuffle_data.end(); it++) {
        std::cout << *it;
    }
    std::cout << std::endl;
}

int main()
{
    Shuffle shuffle;
    (void) shuffle.run();
}

Compiler output:
a.cc: In member function 'void Shuffle::read()':
a.cc:41:14: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
   41 |         std::memset(&tmp, 0, sizeof(tmp));
      |              ^~~~~~
      |              wmemset
a.cc:43:23: error: 'strcmp' is not a member of 'std'
   43 |         if (0 == std::strcmp("-", line.c_str())) {
      |                       ^~~~~~
a.cc:46:9: error: 'memcpy' was not declared in this scope
   46 |         memcpy(tmp.data, line.c_str(), sizeof(tmp.data));
      |         ^~~~~~
a.cc:6:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <cctype>
  +++ |+#include <cstring>
    6 |
Language: C++

#include <iostream>
#include <string>
#include <cctype>

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

  while() {
    if(str[0] == '-') break;
    if(isdigit(str[0])) n = std::atoi(str);
    std::string sub = str.substr(0, n);
    for(int i = 0; sub[i] != '\0'; ++i) {
      str[i] = str[n + i];
      str[n + i] = sub[i];
    }
    std::cout << str << str::endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'int'
    7 |   int n;
      |   ^~~
a.cc:9:9: error: expected primary-expression before ')' token
    9 |   while() {
      |         ^
a.cc:10:8: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |     if(str[0] == '-') break;
      |        ^~~
      |        std
a.cc:11:16: error: 'str' was not declared in this scope; did you mean 'std'?
   11 |     if(isdigit(str[0])) n = std::atoi(str);
      |                ^~~
      |                std
a.cc:11:25: error: 'n' was not declared in this scope
   11 |     if(isdigit(str[0])) n = std::atoi(str);
      |                         ^
a.cc:12:23: error: 'str' was not declared in this scope; did you mean 'std'?
   12 |     std::string sub = str.substr(0, n);
      |                       ^~~
      |                       std
a.cc:12:37: error: 'n' was not declared in this scope
   12 |     std::string sub = str.substr(0, n);
      |                                     ^
a.cc:17:25: error: 'str' is not a class, namespace, or enumeration
   17 |     std::cout << str << str::endl;
      |                         ^~~
Language: C++

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

int main(){
    int m,h;
    while(1){
        cin >> str;
        if(str[0] == '-') break;
        cin >> m;
        for(int i = 0; i < m; ++i){
            cin >> h;
            string right = str.substr(0, h);
            string left = str.substr(h, str.length() - h);
            str = left + right;
        }
        cout << str << endl;
    }
    return 0;
}

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

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

using namespace std;

int mian(){

	string n, a;
	int m;
	int h;
	int i = 0, j = 0;

	while (1){
		cin >> n;
		
		if (n =="-")break;
		a = n + n;

		cin >> m;
		for ( i = 0; i < m; i++)
		{
			cin >> h;
			for ( j = 0; j < n.size(); j++)
			{
				n[j] = a[j + h];
			}
			a = n + n;
		}
		cout << n << 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++

while 1:
    n=input()
    if len(n)==1:break
    for i in range(int(input())):
        a=int(input())
        n=n[a:]+n[:a]
    print(n)


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while 1:
      | ^~~~~
Language: C++

import java.util.Scanner;

public class Main {
	public static void main(String [] args) {
		
		Scanner scan = new Scanner(System.in);
		final String END = "_";
		int shuffle;
		int replace;
		String word, str;
		
		while (true) {
			
			word = scan.next();
			if (word.equals("_")) break;
			
			shuffle = scan.nextInt();
			replace = 0;
			
			for (int i = 0; i < shuffle; i++) {
				replace += scan.nextInt();
			}
			
			if ( replace % word.length() != 0) {
				str = word.substring(0, replace % word.length());
				word = word.replaceFirst(str, "");
				word += str;
			}
			
			System.out.println(word);
			
		} 
		
		scan.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:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		final String END = "_";
		int shuffle;
		int replace;
		String word, str;
		

			
			word = scan.next();
			if (word.equals("_")){
				break;
			}
			

			
			System.out.println(word);
			
		
		
		scan.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:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

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

int main(){
    while(1){
        string s;
        cin>>s;
        if(s=="-"){
            break;
        }
        int m;
        cin>>m;
        for(int i=0;i<m;i++){
            string tmp=s;
            s="";
            int h;
            cin>>h;
            for(int j=h;j<(int)tmp.size();j++){
                s+=tmp[j];
            }
        }
        cout<<s<<endl;
    }
    return 0;
}


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

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

int main(){
    while(1){
        string s;
        cin>>s;
        if(s=="-"){
            break;
        }
        int m;
        cin>>m;
        for(int i=0;i<m;i++){
            string tmp=s;
            s="";
            int h;
            cin>>h;
            for(int j=h;j<(int)tmp.size();j++){
                s+=tmp[j];
            }
            for(int j=0;j<hj++){
                s+=tmp[j];
            }
        }
        cout<<s<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: 'hj' was not declared in this scope; did you mean 'j'?
   21 |             for(int j=0;j<hj++){
      |                           ^~
      |                           j
a.cc:21:31: error: expected ';' before ')' token
   21 |             for(int j=0;j<hj++){
      |                               ^
      |                               ;
Language: C++

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

int main(){
	while(1){
		int n, h, m;
		string str, c1, c2;
		
		cin>>str>>m;

		if (str = "-") break;
		
		for(int i = 0; i < m; i++){
			cin>>h;
			
			for(int j = 0; j < h; j++){
				c1[j] = str[j];
			}
			for(int j = 0; j < (int) str.size() - h; j++) {
				c2[j] = str[j + h];
			}
			str = c2 + c1;	
		}
	
		cout<<str<<endl;

	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: could not convert 'str.std::__cxx11::basic_string<char>::operator=(((const char*)"-"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 |                 if (str = "-") break;
      |                     ~~~~^~~~~
      |                         |
      |                         std::__cxx11::basic_string<char>
Language: C++

#include<cctype>
using namespace std;
int main(){
	string n,right,left;     //n=n枚のカード
	int num;      //num=シャッフル回数
	int num2 = 0; //num2=シャッフル枚数

	while (1){
		cin >> n;
		cin >> num;
		if (n == "-")break;
		for (int i = 0; i < num; i++){
			cin >> num2;
			left = n.substr(0, num2);
			right = n.substr(num2, n.size());
			n = right + left;
		}
		cout << n << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'string' was not declared in this scope
    4 |         string n,right,left;     //n=n枚のカード
      |         ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include<cctype>
  +++ |+#include <string>
    2 | using namespace std;
a.cc:9:17: error: 'cin' was not declared in this scope
    9 |                 cin >> n;
      |                 ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cctype>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:9:24: error: 'n' was not declared in this scope
    9 |                 cin >> n;
      |                        ^
a.cc:14:25: error: 'left' was not declared in this scope
   14 |                         left = n.substr(0, num2);
      |                         ^~~~
a.cc:2:1: note: 'std::left' is defined in header '<ios>'; this is probably fixable by adding '#include <ios>'
    1 | #include<cctype>
  +++ |+#include <ios>
    2 | using namespace std;
a.cc:15:25: error: 'right' was not declared in this scope
   15 |                         right = n.substr(num2, n.size());
      |                         ^~~~~
a.cc:15:25: note: 'std::right' is defined in header '<ios>'; this is probably fixable by adding '#include <ios>'
a.cc:18:17: error: 'cout' was not declared in this scope
   18 |                 cout << n << endl;
      |                 ^~~~
a.cc:18:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:30: error: 'endl' was not declared in this scope
   18 |                 cout << n << endl;
      |                              ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<cctype>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			String s = sc.next();
			if(s == "-")	break;
			int m = sc.nextInt();
			for(int i=0; i < m; i++) {
				int h = sc.nextInt();
				String head = s.substring(0, h);
				String tail = s.substring(h);
				s = tail + head;
			}
			System.out.printf("%s\n", s);
		}
	}
}



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:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

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

int main()
{
	while (true)
	{
		string text;
		int tryno;

		cin >> text;
		if (text == "-") break;

		cin >> tryno;

		for (int i = 0; i < tryno; i++)
		{
			int n;
			cin >> n;

			string the_text = text;

			for (int j = 0; j < n; j++)
			{
				string new_text = "";
				for (int k = 1; k < text.length(); k++)
				{
					new_text += the_text[k];
				}
				new_text += the_text[0];
				the_text = new_text;
			}

			text = the_text;			
		}

		cout << text << endl;
	}
}


Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

puts $<.read.chop(2).split(/([a-z]+[\n0-9]+)/).reject(&:empty?).map(&:split).map{|a|w=a.shift;a.shift;(w*2)[a.map(&:to_i).reduce(:+).to_i%w.length,w.length]}


Compiler output:
a.cc:1:37: error: stray '\' in program
    1 | puts $<.read.chop(2).split(/([a-z]+[\n0-9]+)/).reject(&:empty?).map(&:split).map{|a|w=a.shift;a.shift;(w*2)[a.map(&:to_i).reduce(:+).to_i%w.length,w.length]}
      |                                     ^
a.cc:1:1: error: 'puts' does not name a type
    1 | puts $<.read.chop(2).split(/([a-z]+[\n0-9]+)/).reject(&:empty?).map(&:split).map{|a|w=a.shift;a.shift;(w*2)[a.map(&:to_i).reduce(:+).to_i%w.length,w.length]}
      | ^~~~
Language: C++



#include<iostream>
 #include<string> using namespace std; int main(){ string str; int n; while(cin >> str){ if(str=="-") break; cin >> n; for(int i=0,h;i<n;i++){ cin >> h; string cat = str.substr(0,h); str.erase(0,h); str+=cat; } cout << str << endl; } } 




Compiler output:
a.cc:4:19: warning: extra tokens at end of #include directive
    4 |  #include<string> using namespace std; int main(){ string str; int n; while(cin >> str){ if(str=="-") break; cin >> n; for(int i=0,h;i<n;i++){ cin >> h; string cat = str.substr(0,h); str.erase(0,h); str+=cat; } cout << str << endl; } }
      |                   ^~~~~
/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 <stdio.h>
#include <string.h>

int main(){
  int m, h;
  char cards[256], temp[256], result[256];
  int i, j=0, len;
  while(1){
    scanf("%s", cards);
    len=strlen(cards);
    if(strcmp(cards, "-")==0 && len==1)break;
    scanf("%d", &m);
    for(;m>;m--){
      scanf("%d", &h);
      strcpy(temp, cards);
      for(i=0; i<h; i++){
        cards[len-h+i]=temp[i];
      }
      for(i=0; i<len-h;i++){
        cards[i]=temp[i+h];
      }
    }
    for(i=0; i<len; i++){
      result[j++]=cards[i];
    }
    result[j++]='\n';
  }
  result[j]='\n';
  printf("%s", result);

  return 0;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected primary-expression before ';' token
   13 |     for(;m>;m--){
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
	string x;
	int a;
	while(true){
		cin>>x;
		cin>>a;
		if(x == "-")break;
		for(int i = 0;i<a;i++){
			x += x.at(i);
			x.erase(i);
		}
			return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C++

include<bits/stdc++.h>
using namespace std;
int main()
{
  string s,s1,s2;

  while(1){
  cin >> s;
  if(s == "-")return 0;
  int n;
  cin >> n;
  for(int i=0;i<n;i++)
    {
      int a;
      cin >> a;

      s1 = s.substr(0,a);
      s2 = s.substr(a ,s.size());
      s = s2 + s1;
 
    }
  cout << s << endl;
  }
  return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string s,s1,s2;
      |   ^~~~~~
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> s;
      |   ^~~
a.cc:8:10: error: 's' was not declared in this scope
    8 |   cin >> s;
      |          ^
a.cc:17:7: error: 's1' was not declared in this scope
   17 |       s1 = s.substr(0,a);
      |       ^~
a.cc:18:7: error: 's2' was not declared in this scope
   18 |       s2 = s.substr(a ,s.size());
      |       ^~
a.cc:22:3: error: 'cout' was not declared in this scope
   22 |   cout << s << endl;
      |   ^~~~
a.cc:22:16: error: 'endl' was not declared in this scope
   22 |   cout << s << endl;
      |                ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
while(1){
string moji;
cin >> moji;
l=moji.size()
if(moji="-") break;
int a;
cin >>a;
for(int i=0; i<a; ++i){
int b;
cin>>b
string mojihi,mojimi;
mojihi = moji.substr(0,b)
mojimi = moji.substr(b,l-b)
moji= mojimi+mijihi
}
cout<<moji<<endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:1: error: 'l' was not declared in this scope
   10 | l=moji.size()
      | ^
a.cc:16:7: error: expected ';' before 'string'
   16 | cin>>b
      |       ^
      |       ;
   17 | string mojihi,mojimi;
      | ~~~~~~ 
a.cc:18:1: error: 'mojihi' was not declared in this scope; did you mean 'moji'?
   18 | mojihi = moji.substr(0,b)
      | ^~~~~~
      | moji
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
while(1){
string moji;
cin >> moji;
l=moji.size();
if(moji="-") break;
int a;
cin >>a;
for(int i=0; i<a; ++i){
int b;
cin>>b;
string mojihi,mojimi;
mojihi = moji.substr(0,b);
mojimi = moji.substr(b,l-b);
moji= mojimi+mijihi;
}
cout<<moji<<endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:1: error: 'l' was not declared in this scope
   10 | l=moji.size();
      | ^
a.cc:11:8: error: could not convert 'moji.std::__cxx11::basic_string<char>::operator=(((const char*)"-"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 | if(moji="-") break;
      |    ~~~~^~~~
      |        |
      |        std::__cxx11::basic_string<char>
a.cc:20:14: error: 'mijihi' was not declared in this scope; did you mean 'mojihi'?
   20 | moji= mojimi+mijihi;
      |              ^~~~~~
      |              mojihi
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
while(1){
string moji;
cin >> moji;
l=moji.size();
if(moji="-") break;
int a;
cin >>a;
for(int i=0; i<a; ++i){
int b;
cin>>b;
string mojihi,mojimi;
mojihi = moji.substr(0,b);
mojimi = moji.substr(b,l-b);
moji= mojimi+mojihi;
}
cout<<moji<<endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:1: error: 'l' was not declared in this scope
   10 | l=moji.size();
      | ^
a.cc:11:8: error: could not convert 'moji.std::__cxx11::basic_string<char>::operator=(((const char*)"-"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 | if(moji="-") break;
      |    ~~~~^~~~
      |        |
      |        std::__cxx11::basic_string<char>
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
while(1){
string moji;
cin >> moji;
l=moji.size();
if(moji=="-") break;
int a;
cin >>a;
for(int i=0; i<a; ++i){
int b;
cin >> b;
string mojihi,mojimi;
mojihi = moji.substr(0,b);
mojimi = moji.substr(b,l-b);
moji= mojimi+mojihi;
}
cout<<moji<<endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:1: error: 'l' was not declared in this scope
   10 | l=moji.size();
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
while(1){
string moji;
cin >> moji;
l=moji.size();
if(moji=="-") {
break;
}
int a;
cin >>a;
for(int i=0; i<a; ++i){
int b;
cin >>b;
string mojihi,mojimi;
mojihi = moji.substr(0,b);
mojimi = moji.substr(b,l-b);
string moji= mojimi+mojihi;
}
cout<<moji<<endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:1: error: 'l' was not declared in this scope
   10 | l=moji.size();
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
while(1){
string moji;
cin >> moji;
l=moji.size();
if(moji=="-") {
break;
}
int a,i;
cin >>a;
for(i=0; i<a; ++i){
int b;
cin >>b;
string mojihi,mojimi;
mojihi = moji.substr(0,b);
mojimi = moji.substr(b,l-b);
moji= mojimi+mojihi;
}
cout<<moji<<endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:1: error: 'l' was not declared in this scope
   10 | l=moji.size();
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
while(1){
string moji;
cin >> moji;
l=moji.size();
if(moji=="-") {
break;
}
int a,i;
cin >>a;
for(i=0; i<a; ++i){
int b;
cin >>b;
string mojihi,mojimi;
mojihi = moji.substr(0,b);
mojimi = moji.substr(b);
moji= mojimi+mojihi;
}
cout<<moji<<endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:1: error: 'l' was not declared in this scope
   10 | l=moji.size();
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
while(1){
string moji;
string mojihi;
string mojimi;
cin >> moji;
l=moji.size();
if(moji=="-") {
break;
}
int a,i;
cin >>a;
for(i=0; i<a; i++){
int b;
cin >>b;
mojihi = moji.substr(0,b);
mojimi = moji.substr(b,l-b);
moji= mojimi+mojihi;
}
cout<<moji<<endl;
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:1: error: 'l' was not declared in this scope
   12 | l=moji.size();
      | ^
Language: Java

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

int main() {
    int n, t=0, h=0;
    string t_card,h_card;
    cin >> n;
    while(n--){
        cin>> t_card >> h_card;
        if(t_card > h_card)
            t += 3;
        else if(t_card < h_card)
            h += 3;
        else{
                t++;
                h++;
            }
    }
    cout<< t << " " << h << endl;
}



Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <string>
^
Main.java:8: error: not a statement
    cin >> n;
        ^
Main.java:10: error: not a statement
        cin>> t_card >> h_card;
                     ^
Main.java:20: error: not a statement
    cout<< t << " " << h << endl;
                         ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
6 errors
Language: Java

import java.util.NoSuchElementException;
import java.util.Scanner;

public class CardGame {
    private static int N = 1000;
    private static int S = 100;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        try {
            int ap = 0, bp = 0;
            int n = Integer.parseInt(sc.nextLine());
            while (sc.hasNext()) {
                String[] cs = sc.nextLine().split(" ");
                if (n > N || cs[0].length() > S || cs[1].length() > S) {
                    System.out.println("Condition is invalid.");
                }
                switch (cs[0].compareTo(cs[1])) {
                    case 1:
                        ap += 3;
                        break;
                    case 0:
                        ap++;
                        bp++;
                    case -1:
                        bp += 3;
                        break;
                }
            }
            System.out.println(ap + " " + bp);
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        }
    }
}



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

import java.util.Scanner;

public class MyClass {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int t = 0, h = 0;
        
        int x = sc.nextInt();
        
        for(int i = 0; i < x; i++){
            String str1 = sc.next();
            String str2 = sc.next();
            if(str1.compareTo(str2)<0){
                h+=3;
            }else if(str1.compareTo(str2)==0){
                t++;
                h++;
            }else{
                t+=3;
            }
        }
        System.out.println(t + " " + h);
    }
}


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



import java.util.Scanner;

public class Main {
	static Scanner scan = new Scanner(System.in);
	public static void main(String[] args) {
		//???????????°
		int turns = Integer.parseInt(scan.nextLine());
		cardJad(turns);
		
	}
	
	/**
	 * ????????????
	 * @param turns
	 */
	private static void cardJad(int turns) {
		//?????¬??????????????????
		int player1 = 0;
		int player2 = 0;
		
		int jad;
		String str = scan.nextLine();
		String[] answer = str.split(" ");
		for (int i = 0; i < turns; i++) {
			jad = answer[0].compareTo(answer[1]);
			if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			}
			if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			}
		System.out.println(player1 + " " + player2);
		
	}
	
	

	
}

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

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

        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt();

        int taro_point = 0, hanako_point = 0;
        String taro_card, hanako_card;
        for (int i = 0; i < n; i ++) {
            taro_card = sc.next();
            hanako_card = sc.next();
            if (taro_card.compareToIgnoreCase(hanako_card) > 0) { taro_point += 3; }
            else if (taro_card.compareToIgnoreCase(hanako_card) == 0) { hanako_point ++; taro_point ++; }
            else (taro_card.compareToIgnoreCase(hanako_card) < 0) { hanako_point += 3; }
        }
        System.out.println(taro_point + " " + hanako_point);
    }
}

Compiler output:
Main.java:14: error: not a statement
            else (taro_card.compareToIgnoreCase(hanako_card) < 0) { hanako_point += 3; }
                 ^
Main.java:14: error: ';' expected
            else (taro_card.compareToIgnoreCase(hanako_card) < 0) { hanako_point += 3; }
                                                                 ^
2 errors
Language: Java

import java.util.*;
import java.io.*;
 
class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int card = Integer.parseInt(br.readLine());    
        String[] str;
        int t=0;
        int h=0;
        for(int i=0; i<card; i++){
          
            str = br.readLine().split(" ");  
            String tarou = str[0];
            String hanako = str[1];
             
            if(judge<0){        
                h += 3;   
            }else if(judge>0){  
                t += 3;   
            }else{              
                h += 1;   
                t += 1;
            }
        }
        System.out.println(t +" "+h);
    }
}

Compiler output:
Main.java:17: error: cannot find symbol
            if(judge<0){        
               ^
  symbol:   variable judge
  location: class Main
Main.java:19: error: cannot find symbol
            }else if(judge>0){  
                     ^
  symbol:   variable judge
  location: class Main
2 errors
Language: Java

import java.util.*;

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

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int T = 0;
		int H = 0;
		for(int i = 0; i < n; i++){
			String sT = scan.next();
			String sH = scan.next();
			if((sT.comparaTo(sH)) < 0){
				T += 3;
			} else if((sT.compareTo(sH)) > 0){
				H += 3;
			} else{
				T++;
				H++;
			}
		}
		System.out.printf("%d %d\n", T, H);
	}
}

Compiler output:
Main.java:13: error: cannot find symbol
			if((sT.comparaTo(sH)) < 0){
			      ^
  symbol:   method comparaTo(String)
  location: variable sT of type String
1 error
Language: Java

import java.io.*;

public class Main1{
	public static void main(String[] arsg) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int a = 0, b = 0;
		for(int i = 0;i<n;i++){
			String str[] = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0) a+=3;
			else if(str[0].compareTo(str[1])<0) b+=3;
			else if(str[0].compareTo(str[1])==0){
			a++;
			b++;
			}
		}
		System.out.println(a+" "+b);
	}
}

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

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        String numOfGame = stdIn.nextLine();

        int taroScore = 0;
        int hanakoScore = 0;
        for(int i = 0; i < numOfGame; i++) {
            String taroHand = stdIn.next();
            String hanakoHand = stdIn.next();
            
            int result = taroHand.compareTo(hanakoHand);
            if(result > 0) {
                // taro win
                taroScore += 3;
            } else if(result < 0) {
                // hanako win
                hanakoScore += 3;
            } else {
                // draw
                taroScore++;
                hanakoScore++;
            }
        }
        System.out.println(taroScore + " " + hanakoScore);
    }
}

Compiler output:
Main.java:11: error: bad operand types for binary operator '<'
        for(int i = 0; i < numOfGame; i++) {
                         ^
  first type:  int
  second type: String
1 error
Language: Java

import java.io.*;
import java.util.*;

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

        String str;

        int taro =0;
        int hana =0;
        String[] temp = new String[2];

        while((str = br.readLine()) != null){
            int n = Integer.parseInt(str);
            for(int i=0;i<n;i++){
                str = br.readLine();
                temp = str.split("\\s");
                char taroc = temp[0].charAt(0);
                char hanac = temp[1].charAt(0);
                //System.out.println(taroc + " " + hanac);
                if(taroc > hanac){
                    taro+=3;
                }else if(taroc == hanac){
                    taro++;
                    hana++;
                }else{
                    hana +=3;
                }
            }
        }

        System.out.println(taro + " " + hana);
    }
}

Compiler output:
Main.java:9: error: variable str is already defined in method main(String[])
        String str;
               ^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        tring str;

        int taro =0;
        int hana =0;
        String[] temp = new String[2];

        while((str = br.readLine()) != null){
            int n = Integer.parseInt(str);
            for(int i=0;i<n;i++){
                str = br.readLine();
                temp = str.split("\\s");
                String t =temp[0].substring(0,1);
                String h = temp[1].substring(0,1);
                int num = t.compareTo(h);

                System.out.println(t + h + num);
                if(num == 0){
                    taro++;
                    hana++;
                }else if(num > 0){
                    taro +=3;
                }else{
                    hana +=3;
                }
            }
        }

        System.out.println(taro + " " + hana);

    }
}

Compiler output:
Main.java:7: error: cannot find symbol
        tring str;
        ^
  symbol:   class tring
  location: class Main
1 error
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n= Integer.parseInt(sc.nextLine());
		int taroPoint=0;
		int hanakoPoint=0;
		for(int i=0;i<n;i++){
			String[] word = sc.nextLine().split(" ");
			int wordlength = word[0].length();
			if(wordlength>word[1].length()){
				wordlength=word[1].length();
			}
			for(int j=0;j<wordlength;j++){
				if(word[0].charAt(j+1)>word[1].charAt(j+1)){
					taroPoint+=3;
					break;
				}else if(word[0].charAt(j+1)<word[1].charAt(j+1)){
					hanakoPoint+=3;
					break;
				}
			}
			if(word[0].equals(word[1])){
				taroPoint+=1;
				hanakoPoint+=1;
			}
		}
		System.out.peintln(taroPoint+" "+hanakoPoint);

Compiler output:
Main.java:29: error: reached end of file while parsing
		System.out.peintln(taroPoint+" "+hanakoPoint);
		                                              ^
1 error
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n= Integer.parseInt(sc.nextLine());
		int taroPoint=0;
		int hanakoPoint=0;
		for(int i=0;i<n;i++){
			String[] word = sc.nextLine().split(" ");
			int wordlength = word[0].length();
			if(wordlength>word[1].length()){
				wordlength=word[1].length();
			}
			for(int j=0;j<wordlength;j++){
				if(word[0].charAt(j+1)>word[1].charAt(j+1)){
					taroPoint+=3;
					break;
				}else if(word[0].charAt(j+1)<word[1].charAt(j+1)){
					hanakoPoint+=3;
					break;
				}
			}
			if(word[0].equals(word[1])){
				taroPoint+=1;
				hanakoPoint+=1;
			}
		}
		System.out.peintln(taroPoint+" "+hanakoPoint);
	}
}

Compiler output:
Main.java:29: error: cannot find symbol
		System.out.peintln(taroPoint+" "+hanakoPoint);
		          ^
  symbol:   method peintln(String)
  location: variable out of type PrintStream
1 error
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n= Integer.parseInt(sc.nextLine());
		int taroPoint=0;
		int hanakoPoint=0;
		
		for(int i=0;i<n;i++){
			String[] word = sc.nextLine().split(" ");
			if(word[0].equals(word[1])){
				taroPoint+=1;
				hanakoPoint+=1;
			}else{
				int wordlength = word[0].length();
				if(wordlength>word[1].length()){
					wordlength=word[1].length();
				}
				for(int j=0;j<wordlength;j++){
					if(word[0].charAt(j)>word[1].charAt(j)){
						taroPoint+=3;
						break;
					}else if(word[0].charAt(j)<word[1].charAt(j)){
						hanakoPoint+=3;
						break;
					}
					if(j==wordlength-1){
						if(word[0].length>word[1].length()){
							taroPoint+=1;
						}else{
							hanakoPoint+=1;
						}
					}
				}
			}
		}
		System.out.println(taroPoint+" "+hanakoPoint);
	}
}

Compiler output:
Main.java:29: error: cannot find symbol
						if(word[0].length>word[1].length()){
						          ^
  symbol:   variable length
  location: class String
1 error
Language: Java

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int turnNum = sc.nextInt();
        int tPoint = 0;
        int hPoint = 0;
 
        for(int i = 0; i < turnNum; i++) {
            String tStr = sc.next();
            String hStr = sc.next();
 
            int check = tStr.compareTo(hStr);
            if(check < 0) {
                hPoint += 3;
            } else if(check == 0) {
                tPoint += 1;
                hPoint += 1;
            } else if(check > 0) {
                tPoint += 3;
            }
 
        }
 
        System.out.println(tPoint + " " + hPoint);
 
    }
}


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

import java.util.Scanner;

public class Main3 {


    public static void main(String[] args) {
        int taro_point = 0;
        int hanako_point = 0;
        int card_num = 0;
        int result_comp;

        String[] taro_card,hanako_card;

        Scanner sc= new Scanner( System.in );

        card_num = sc.nextInt();

        taro_card = new String[card_num];
        hanako_card = new String[card_num];

        for ( int i = 0 ; i < card_num ; i++ ) {
            taro_card[i] = sc.next();
            hanako_card[i] = sc.next();
        }

        for ( int i = 0 ; i < card_num ; i++ ) {
            result_comp = 0;
            result_comp = taro_card[i].compareTo(hanako_card[i]);

            if ( result_comp < 0 ) {
                hanako_point += 3;
            }else if ( result_comp == 0 ) {
                taro_point ++;
                hanako_point ++;
            }else if ( result_comp > 1 ) {
                taro_point += 3;
            }

        }
        System.out.println( taro_point + " " + hanako_point );
        sc.close();
    }
}


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

mport java.util.Scanner;

public class M {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc=new Scanner(System.in);
		
		int n=sc.nextInt();
		int L=0,R=0;
		for (int i=0;i<n;i++) {
			String s1=sc.next();
			String s2=sc.next();
			
			if (s1.compareTo(s2)==0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2)<0) {
				L=L+3;
			}
			else {
				R=R+3;
			}
		}
		
		System.out.println(R + " "+L);
				sc.close();
	}

}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: Java

mport java.util.Scanner;

public class M {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc=new Scanner(System.in);
		
		int n=sc.nextInt();
		int L=0,R=0;
		for (int i=0;i<n;i++) {
			String s1=sc.next();
			String s2=sc.next();
			
			if (s1.compareTo(s2)==0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2)<0) {
				L=L+3;
			}
			else {
				R=R+3;
			}
		}
		
		System.out.println(R + " "+ L);
				sc.close();
	}

}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: Java

import java.util.Scanner;
public class test{
    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();
        	System.out.println(data[0]);
        	System.out.println(data[1]);
        	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(scoa1+" "+scoa2);
        sc.close();
        
        
        


    }
}


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