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

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

class ABProblem{
	public static void main(String args[]){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input_str;
		try{
			while((input_str = br.readLine()) != null){
				String[] input_strs = input_str.split(" ");
				int a = Integer.parseInt(input_strs[0]);
				int b = Integer.parseInt(input_strs[1]);
				System.out.println(a + b);
			}
		}catch(Exception e){
			//System.err.println(e);
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:15: error: expected ':' before 'static'
    5 |         public static void main(String args[]){
      |               ^~~~~~~
      |               :
a.cc:5:33: error: 'String' has not been declared
    5 |         public static void main(String args[]){
      |                                 ^~~~~~
a.cc:19:2: error: expected ';' after class definition
   19 | }
      |  ^
      |  ;
a.cc: In static member function 'static void ABProblem::main(int*)':
a.cc:6:17: error: 'BufferedReader' was not declared in this scope
    6 |                 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      |                 ^~~~~~~~~~~~~~
a.cc:7:17: error: 'String' was not declared in this scope
    7 |                 String input_str;
      |                 ^~~~~~
a.cc:9:32: error: 'input_str' was not declared in this scope
    9 |                         while((input_str = br.readLine()) != null){
      |                                ^~~~~~~~~
a.cc:9:44: error: 'br' was not declared in this scope
    9 |                         while((input_str = br.readLine()) != null){
      |                                            ^~
a.cc:9:62: error: 'null' was not declared in this scope
    9 |                         while((input_str = br.readLine()) != null){
      |                                                              ^~~~
a.cc:10:40: error: expected primary-expression before ']' token
   10 |                                 String[] input_strs = input_str.split(" ");
      |                                        ^
a.cc:11:41: error: 'Integer' was not declared in this scope
   11 |                                 int a = Integer.parseInt(input_strs[0]);
      |                                         ^~~~~~~
a.cc:11:58: error: 'input_strs' was not declared in this scope
   11 |                                 int a = Integer.parseInt(input_strs[0]);
      |                                                          ^~~~~~~~~~
a.cc:13:33: error: 'System' was not declared in this scope
   13 |                                 System.out.println(a + b);
      |                                 ^~~~~~
a.cc:15:24: error: 'Exception' does not name a type
   15 |                 }catch(Exception e){
      |                        ^~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int a,b;
  whilc (cin>>a>>b) {
    cout<<a+b<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'whilc' was not declared in this scope
    6 |   whilc (cin>>a>>b) {
      |   ^~~~~
Language: C++

#include<iostream>
#include<cstdio>

int main(void){
  int a,b;
  while(cin>>a>>b!=EOF)
    cout<<a+b<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   while(cin>>a>>b!=EOF)
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |     cout<<a+b<<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:7:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |     cout<<a+b<<endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

import java.util.Scanner;
public class Main2 { 
	public static void main(String[] args) { 
 
Scanner sc = new Scanner(System.in); 

 int x = sc.nextInt(); int answer = x*x*x; 
  System.out.println(answer);  
   } 
}

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

import java.util.Scanner;

public class A {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		while (sc.hasNext()) {
			char query = sc.next().charAt(0);
			String tree1 = sc.next();
			String tree2 = sc.next();
			Node root = new Node();
			parse(tree1, 0, root, 1);
			parse(tree2, 0, root, 2);
			root.write(query == 'u');
			System.out.println();
		}
	}

	static int parse(String tree, int pos, Node cur, int val) {
		cur.val += val;
		++pos;
		if (tree.charAt(pos) == '(') {
			if (cur.left == null) {
				cur.left = new Node();
			}
			pos = parse(tree, pos, cur.left, val);
		}
		++pos;
		if (tree.charAt(pos) == '(') {
			if (cur.right == null) {
				cur.right = new Node();
			}
			pos = parse(tree, pos, cur.right, val);
		}
		return pos + 1;
	}

	static class Node {
		Node left;
		Node right;
		int val = 0;

		boolean match(boolean union) {
			if (union) {
				return this.val > 0;
			} else {
				return this.val == 3;
			}
		}

		void write(boolean union) {
			if (!match(union)) return;
			System.out.print("(");
			if (this.left != null) this.left.write(union);
			System.out.print(",");
			if (this.right != null) this.right.write(union);
			System.out.print(")");
		}
	}
}

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

import java.util.Scanner;


public class _1001_BinaryTreeIntersectionAndUnion {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			int order = scan.next().equals("i") ? 0 : 1;

			boolean[] tree1 = decode(scan.next());
			boolean[] tree2 = decode(scan.next());
			print(tree1,tree2,order);
		}
	}

	public static boolean[] decode(String str){
		boolean[] tree = new boolean[101];
		int pos = 0;
		for (int i = 0; i < str.length(); i++) {
			char ch = str.charAt(i);
			if(ch=='('){
				tree[pos]=true;
				pos = pos*2+1;
			}
			if(ch==','){
				pos = pos+1;
			}
			if(ch==')'){
				pos = (pos-1)/2;
			}
		}
		return tree;
	}

	public static Tree[] tr;

	public static void print(boolean[] tree1,boolean[] tree2,int order){
		tr = new Tree[101];
		for (int i = 0; i < 101; i++) {
			boolean a = tree1[i];
			boolean b = tree2[i];
			boolean leaf = order==0 ? (a && b) : (a || b);

			if(leaf){
				int par = (i-1)/2;
				if(i==0) tr[i] = new Tree();
				else{
					tr[i] = new Tree();
					if(i%2==0) tr[par].r=tr[i];
					else tr[par].l=tr[i];
				}
			}
		}

		System.out.println(trp(tr[0]));
	}

	public static String trp(Tree tree){
		String str = "(";
		if(tree.l!=null) str+=trp(tree.l);
		str+=",";
		if(tree.r!=null) str+=trp(tree.r);
		str+=")";
		return str;
	}
}

class Tree{
	Tree l=null,r=null;
}

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

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


struct Tree{
	Tree *l,*r;
	Tree():l(0),r(0){}
	~Tree(){delete l;delete r;}
};

Tree* to_t(string s){
	Tree *t=new Tree();
	if(s=="")return 0;
	if(s=="(,)")return t;
	int lev=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='(')lev++;
		else if(s[i]==')')lev--;
		else if(lev==1&&s[i]==','){
			t->l=to_t(s.substr(1,i-1));
			t->r=to_t(s.substr(i+1,s.size()-(i+1)-1));
			break;
		}
	}
	return t;
}
string intersection(Tree *s,Tree *t){
	string res;
	if(!s||!t)return res;
	res+='(';
	res+=intersection(s->l,t->l);
	res+=',';
	res+=intersection(s->r,t->r);
	res+=')';
	return res;
}
string _union(Tree *s,Tree *t){
	string res;
	if(!s&&!t)return res;
	res+='(';
	res+=_union(s?s->l:0,t?t->l:0);
	res+=',';
	res+=_union(s?s->r:0,t?t->r:0);
	res+=')';
	return res;
}


int main(){
	char op;
	string a,b;
	Tree * s,*t;
	while(cin>>op>>a>>b){
		s=to_t(a);
		t=to_t(b);
		if(op=='i')cout<<intersection(s,t)<<endl;
		else cout<<_union(s,t)<<endl;
		delete s;
		delete t;
	}
	return 0;
}

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

#include <iostream>
#include <limits.h>
#include <queue>
#include <algorithm>
#include <string>

//typedef pair<int,int> P;

using namespace std;

const int INF=INT_MAX/3;
const int N=100;

int heap[N];
string output;

void parse(string &s,int id){

  //cout<<s<<":"<<id<<endl;
  if(s.empty()) return;

  heap[id]++;
  if(s=="(,)")  return;
  
  
  int cnt=0;
 
  for(int i=1;i<s.length()-1;i++){
    if(s[i]=='(') cnt++;
    if(s[i]==')') cnt--;   
    if(s[i]==',' && cnt==0){
      string sub1=s.substr(1,i-1);
      string sub2=s.substr(i+1,s.length()-i-2);
      parse(sub1, 2*id+1);
      parse(sub2, 2*id+2);
      break;
    }
  }
  return;
}

int out(int th, int id,int n){

  string c("(,)");
  for(int i=0;i<3;i++)
    output.insert(output.begin()+n+i,c[i]);

  int ch1=0,ch2=0;//n of string of each child
  
  if(heap[id]>th){
    if(heap[2*id+1]>th){
      ch1=out(th,2*id+1,n+1);
    }
    if(heap[2*id+2]>th){
      ch2=out(th,2*id+2,n+ch1+2);
    }
  }
  return ch1+ch2+3;
  
}

void print(){

  for(int i=0;i<N;i++)
    cout<<"["<<i<<"]"<<heap[i]<<endl;
}

void solve(string cmd,string &s1,string &s2){

  fill(heap,heap+N,0);
  output.clear();
  //cout<<output<<endl;
  parse(s1,0);
  parse(s2,0);


  int th=-1;
  if(cmd=="u") th=0;
  if(cmd=="i") th=1;
  out(th,0,0);
  
  cout<<output<<endl;
}



int main(){

  string cmd,s1,s2;
  
  cin>>cmd>>s1>>s2
    solve(cmd,s1,s2);
cout<<"hoge";
  

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:91:19: error: expected ';' before 'solve'
   91 |   cin>>cmd>>s1>>s2
      |                   ^
      |                   ;
   92 |     solve(cmd,s1,s2);
      |     ~~~~~
Language: C++

#include <iostream>
#include <limits.h>
#include <queue>
#include <algorithm>
#include <string>

//typedef pair<int,int> P;

using namespace std;

const int INF=INT_MAX/3;
const int N=1000;

int heap[N];
string output;

void parse(string &s,int id){

  //cout<<s<<":"<<id<<endl;
  if(s.empty()) return;

  heap[id]++;
  if(s=="(,)") return;
  if(id>=N) break;
  
  int cnt=0;
 
  for(int i=1;i<s.length()-1;i++){
    if(s[i]=='(') cnt++;
    if(s[i]==')') cnt--;  
    if(s[i]==',' && cnt==0){
      string sub1=s.substr(1,i-1);
      string sub2=s.substr(i+1,s.length()-i-2);
      if(i-1>=0) parse(sub1, 2*id+1);
      if(s.length()-i-2>=0)parse(sub2, 2*id+2);
      break;
    }
  }
  return;
}

void out(int th, int id){

  output.push_back('(');

  int ch1=0,ch2=0;//n of string of each child
  
  if(heap[id]>th && heap[2*id+1]>th){
    out(th,2*id+1);
  }
  output.push_back(',');
  if(heap[id]>th && heap[2*id+2]>th){
    out(th,2*id+2);
  }
  
  output.push_back(')');
  return;
  
}

void print(){

  for(int i=0;i<N;i++)
    cout<<"["<<i<<"]"<<heap[i]<<endl;
}

void solve(string cmd,string &s1,string &s2){

  fill(heap,heap+N,0);
  output.clear();
  //cout<<output<<endl;
  parse(s1,0);
  parse(s2,0);


  int th=-1;
  if(cmd=="u") th=0;
  if(cmd=="i") th=1;
  out(th,0);
  
  cout<<output<<endl;
}



int main(){

  string cmd,s1,s2;
  int i=0;
  
  while(cin>>cmd>>s1>>s2){
    solve(cmd,s1,s2);
  }

  return 0;
}

Compiler output:
a.cc: In function 'void parse(std::string&, int)':
a.cc:24:13: error: break statement not within loop or switch
   24 |   if(id>=N) break;
      |             ^~~~~
Language: C++

#include <cstdio>

using namespace std;

const int nil = -1;
const int MAX_N = 256;

struct Node {
  int l, r, cnt;
  Node() {
    l = r = nil;
    cnt = 0;
  }
};

Node v[MAX_N];
int nodeIndex;

int parse(const char *s, int n, int root) {
  v[root].cnt++;
  if (s[++n] != ',') {
    if (v[root].l == nil) v[root].l = ++nodeIndex;
    n = parse(s, n, v[root].l);
  }
  if (s[++n] != ')') {
    if (v[root].r == nil) v[root].r = ++nodeIndex;
    n = parse(s, n, v[root].r);
  }
  return n+1;
}

void print(int root, int cnt) {
  if (v[root].cnt < cnt) return;
  putchar('(');
  if (v[root].l != nil) print(v[root].l, cnt);
  putchar(',');
  if (v[root].r != nil) print(v[root].r, cnt);
  putchar(')');
}

int main() {
  char op[10], t1[1024], t2[1024];
  while (scanf("%s %s %s", op, t1, t2) == 3) {
    for (int i=0;i<MAX_N;i++) v[i] = Node();
    nodeIndex = 0;
    parse(t1, 0, 0);
    parse(t2, 0, 0);
    print(0, (op=='u'?1:2)); putchar('\n');
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   48 |     print(0, (op=='u'?1:2)); putchar('\n');
      |               ~~^~~~~
Language: C++

#include <iostream>
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
using namespace std;

struct bad_input { };
struct Node;
typedef boost::shared_ptr<Node> NodePtr;
struct Node {
	NodePtr left;
	NodePtr right;
};

void show_intersection_tree(NodePtr root1, NodePtr root2)
{
	std::cout << '(';
	if (root1->left && root2->left) {
		show_intersection_tree(root1->left, root2->left);
	}
	std::cout << ',';
	if (root1->right && root2->right) {
		show_intersection_tree(root1->right, root2->right);
	}
	std::cout << ')';
}

void show_union_tree(NodePtr root1, NodePtr root2)
{
	std::cout << '(';
	if ((root1 && root1->left) || (root2 && root2->left)) {
		show_union_tree(root1 ? root1->left : root1, root2 ? root2->left : root2);
	}
	std::cout << ',';
	if ((root1 && root1->right) || (root2 && root2->right)) {
		show_union_tree(root1 ? root1->right : root1, root2 ? root2->right : root2);
	}
	std::cout << ')';
}

char get_token()
{
	char c;
	while (std::cin >> c) {
		if (c == '(' || c == ',' || c == ')') {
			break;
		}
		if (c != '\n' && c != ' ') {
			throw bad_input();
		}
	}
	return c;
}

NodePtr make_node(int no)
{
	NodePtr node = boost::make_shared<Node>();
	char c = get_token();
	if (c == '(') {
		node->left = make_node(no + 1);
		c = get_token();
	}
	if (c == ',') {
	}
	else {
		throw bad_input();
	}
	c = get_token();
	if (c == '(') {
		node->right = make_node(no + 1);
		c = get_token();
	}
	if (c == ')') {
	}
	else {
		throw bad_input();
	}
	return node;
}

int main()
{
	char op;
	while (std::cin >> op) {
		NodePtr root1, root2;
		if (get_token() == '(') {
			root1 = make_node(0);
		}
		else {
			throw bad_input();
		}
		if (get_token() == '(') {
			root2 = make_node(0);
		}
		else {
			throw bad_input();
		}
		if (op == 'i') {
			if (root1 && root2) {
				show_intersection_tree(root1, root2);
			}
		}
		else if (op == 'u') {
			if (root1 || root2) {
				show_union_tree(root1, root2);
			}
		}
		std::cout << std::endl;
	}
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: boost/shared_ptr.hpp: No such file or directory
    2 | #include <boost/shared_ptr.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <boost/shared_ptr.hpp>
using namespace std;

struct bad_input { };
struct Node;
typedef boost::shared_ptr<Node> NodePtr;
struct Node {
	NodePtr left;
	NodePtr right;
};

void show_intersection_tree(NodePtr root1, NodePtr root2)
{
	std::cout << '(';
	if (root1->left && root2->left) {
		show_intersection_tree(root1->left, root2->left);
	}
	std::cout << ',';
	if (root1->right && root2->right) {
		show_intersection_tree(root1->right, root2->right);
	}
	std::cout << ')';
}

void show_union_tree(NodePtr root1, NodePtr root2)
{
	std::cout << '(';
	if ((root1 && root1->left) || (root2 && root2->left)) {
		show_union_tree(root1 ? root1->left : root1, root2 ? root2->left : root2);
	}
	std::cout << ',';
	if ((root1 && root1->right) || (root2 && root2->right)) {
		show_union_tree(root1 ? root1->right : root1, root2 ? root2->right : root2);
	}
	std::cout << ')';
}

char get_token()
{
	char c;
	while (std::cin >> c) {
		if (c == '(' || c == ',' || c == ')') {
			break;
		}
		if (c != '\n' && c != ' ') {
			throw bad_input();
		}
	}
	return c;
}

NodePtr make_node(int no)
{
	NodePtr node = boost::make_shared<Node>();
	char c = get_token();
	if (c == '(') {
		node->left = make_node(no + 1);
		c = get_token();
	}
	if (c == ',') {
	}
	else {
		throw bad_input();
	}
	c = get_token();
	if (c == '(') {
		node->right = make_node(no + 1);
		c = get_token();
	}
	if (c == ')') {
	}
	else {
		throw bad_input();
	}
	return node;
}

int main()
{
	char op;
	while (std::cin >> op) {
		NodePtr root1, root2;
		if (get_token() == '(') {
			root1 = make_node(0);
		}
		else {
			throw bad_input();
		}
		if (get_token() == '(') {
			root2 = make_node(0);
		}
		else {
			throw bad_input();
		}
		if (op == 'i') {
			if (root1 && root2) {
				show_intersection_tree(root1, root2);
			}
		}
		else if (op == 'u') {
			if (root1 || root2) {
				show_union_tree(root1, root2);
			}
		}
		std::cout << std::endl;
	}
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: boost/shared_ptr.hpp: No such file or directory
    2 | #include <boost/shared_ptr.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

class Node
  attr_reader :left, :right
  def initialize(left,right)
    @left = left
    @right = right
  end
  def to_s
    "(#{@left||""},#{@right||""})"
  end
end

class Parser
  def initialize(str)
    @str = str
    @idx = 0
  end
  def read
    if @str[@idx] == ?(
      @idx += 1
      l = read
      @idx += 1
      r = read
      @idx += 1
      Node.new(l,r)
    else
      nil
    end
  end
end

def its (a,b)
  if a && b
    Node.new(its(a.left,b.left),its(a.right,b.right))
  else
    nil
  end
end

def uni (a,b)
  if !a
    b
  elsif !b
    a
  else
    Node.new(uni(a.left,b.left),uni(a.right,b.right))
  end
end

while line = gets
  ch, a, b = line.split
  c = Parser.new(a).read
  d = Parser.new(b).read

  if ch=="i"
    puts its(c,d)
  elsif ch=="u"
    puts uni(c,d)
  end
end

Compiler output:
a.cc:4:5: error: stray '@' in program
    4 |     @left = left
      |     ^
a.cc:5:5: error: stray '@' in program
    5 |     @right = right
      |     ^
a.cc:14:5: error: stray '@' in program
   14 |     @str = str
      |     ^
a.cc:15:5: error: stray '@' in program
   15 |     @idx = 0
      |     ^
a.cc:18:8: error: stray '@' in program
   18 |     if @str[@idx] == ?(
      |        ^
a.cc:18:13: error: stray '@' in program
   18 |     if @str[@idx] == ?(
      |             ^
a.cc:19:7: error: stray '@' in program
   19 |       @idx += 1
      |       ^
a.cc:21:7: error: stray '@' in program
   21 |       @idx += 1
      |       ^
a.cc:23:7: error: stray '@' in program
   23 |       @idx += 1
      |       ^
a.cc:2:15: error: found ':' in nested-name-specifier, expected '::'
    2 |   attr_reader :left, :right
      |               ^
      |               ::
a.cc:2:3: error: 'attr_reader' has not been declared
    2 |   attr_reader :left, :right
      |   ^~~~~~~~~~~
a.cc:2:16: error: aggregate 'Node left' has incomplete type and cannot be defined
    2 |   attr_reader :left, :right
      |                ^~~~
a.cc:2:22: error: expected unqualified-id before ':' token
    2 |   attr_reader :left, :right
      |                      ^
Language: C++


    else 
      return max(strL, strR);
  }

  string sL1, sL2, sR1, sR2;
  divide(strL, sL1, sL2);
  divide(strR, sR1, sR2)

  return "(" + solve(op, sL1, sL2) + "," + solve(op, s2, t2) + ")";
}

int main() {

Compiler output:
a.cc:2:5: error: expected unqualified-id before 'else'
    2 |     else
      |     ^~~~
a.cc:4:3: error: expected declaration before '}' token
    4 |   }
      |   ^
a.cc:6:3: error: 'string' does not name a type
    6 |   string sL1, sL2, sR1, sR2;
      |   ^~~~~~
a.cc:7:9: error: expected constructor, destructor, or type conversion before '(' token
    7 |   divide(strL, sL1, sL2);
      |         ^
a.cc:8:9: error: expected constructor, destructor, or type conversion before '(' token
    8 |   divide(strR, sR1, sR2)
      |         ^
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
a.cc: In function 'int main()':
a.cc:13:13: error: expected '}' at end of input
   13 | int main() {
      |            ~^
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>
#include <boost/format.hpp>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

const int INF = 1 << 24;
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

typedef unsigned long long ull;
typedef std::pair<std::string,std::string> P;

std::string substring(std::string s, int begin, int end){
    return s.substr(begin, end-begin);
}

P child(std::string tree){
    P res;
    int parLevel = 0;

    for(int i=1;i<tree.size()-1;i++){
        if(tree[i] == '('){
            parLevel++;
        }else if(tree[i] == ')'){
            parLevel--;
        }else if(tree[i] == ',' && !parLevel){
            res.first = substring(tree, 1, i);
            res.second = substring(tree, i+1, tree.size()-1);
        }
    }

    return res;
}

std::string Union(std::string a, std::string b){
    P a_child = child(a), b_child = child(b);
    std::string 
        al_child = a_child.first,
        ar_child = a_child.second,
        bl_child = b_child.first,
        br_child = b_child.second,
        l_child = "",
        r_child = "";

    // std::cout << boost::format("%1% %2%") % al_child % ar_child << std::endl;
    // std::cout << boost::format("%1% %2%") % bl_child % br_child << std::endl;
        
    if(al_child != "" && bl_child == ""){
        l_child = al_child;
    }else if(al_child == "" && bl_child != ""){
        l_child = bl_child;
    }else if(al_child != "" && bl_child != ""){
        l_child = Union(al_child, bl_child);
    }

    if(ar_child != "" && br_child == ""){
        r_child = ar_child;
    }else if(ar_child == "" && br_child != ""){
        r_child = br_child;
    }else if(ar_child != "" && br_child != ""){
        r_child = Union(ar_child, br_child);
    }

    // std::cout << "Result: " << "(" + l_child + "," + r_child + ")" << std::endl;
    return "(" + l_child + "," + r_child + ")";
}

std::string Intersection(std::string a, std::string b){
    P a_child = child(a), b_child = child(b);
    std::string 
        al_child = a_child.first,
        ar_child = a_child.second,
        bl_child = b_child.first,
        br_child = b_child.second,
        l_child = "",
        r_child = "";

    if(al_child != "" && bl_child != ""){
        l_child = Intersection(al_child, bl_child);
    }

    if(ar_child != "" && br_child != ""){
        r_child = Intersection(ar_child, br_child);
    }

    return "(" + l_child + "," + r_child + ")";
}

int main(){
    char c;
    std::string a, b;

    while(std::cin >> c >> a >> b, !std::cin.eof()){
        if(c == 'u'){
            std::cout << Union(a, b) << std::endl;
        }else if(c == 'i'){
            std::cout << Intersection(a, b) << std::endl;
        }
    }
}

Compiler output:
a.cc:10:10: fatal error: boost/format.hpp: No such file or directory
   10 | #include <boost/format.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>
#include <tuple>

#ifdef _MSC_VER
#include <agents.h>
#endif

#define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define REV(v) rbegin(v), rend(v)
#define MEMSET(v, s) memset(v, s, sizeof(v))
#define X first
#define Y second

using namespace std;

using ll = long long;
using P = pair<int, int>;

string tree(const string &s, int &pos){
	string chl, chr;
	++pos;
	if (s[pos] == '(') chl = tree(s, pos);
	++pos;
	if (s[pos] == '(') chr = tree(s, pos);
	++pos;
	return "(" + chl + "," + chr + ")";
}

char c;
string a, b;
int p1, p2;

string and(){
	++p1, ++p2;

	string chl, chr;
	if (a[p1] == '(' && b[p2] == '('){
		chl = and();
	}
	else if (a[p1] == '('){
		tree(a, p1);
	}
	else if (b[p2] == '('){
		tree(b, p2);
	}

	++p1, ++p2;

	if (a[p1] == '(' && b[p2] == '('){
		chr = and();
	}
	else if (a[p1] == '('){
		tree(a, p1);
	}
	else if (b[p2] == '('){
		tree(b, p2);
	}

	++p1, ++p2;

	return "(" + chl + "," + chr + ")";
}

string or(){
	++p1, ++p2;

	string chl, chr;
	if (a[p1] == '(' && b[p2] == '('){
		chl = or();
	}
	else if (a[p1] == '('){
		chl = tree(a, p1);
	}
	else if (b[p2] == '('){
		chl = tree(b, p2);
	}

	++p1, ++p2;

	if (a[p1] == '(' && b[p2] == '('){
		chr = and();
	}
	else if (a[p1] == '('){
		chr = tree(a, p1);
	}
	else if (b[p2] == '('){
		chr = tree(b, p2);
	}

	++p1, ++p2;

	return "(" + chl + "," + chr + ")";
}

int main(){
	while (cin >> c >> a >> b){
		p1 = p2 = 0;

		if (c == 'i') cout << and() << endl;
		else cout << or() << endl;
	}

	return 0;
}

Compiler output:
a.cc:49:12: error: expected unqualified-id before ')' token
   49 | string and(){
      |            ^
a.cc:80:8: error: expected unqualified-id before 'or' token
   80 | string or(){
      |        ^~
a.cc: In function 'int main()':
a.cc:115:42: error: expected identifier before '(' token
  115 |                 if (c == 'i') cout << and() << endl;
      |                                          ^
a.cc:116:30: error: expected primary-expression before 'or' token
  116 |                 else cout << or() << endl;
      |                              ^~
a.cc:116:33: error: expected primary-expression before ')' token
  116 |                 else cout << or() << endl;
      |                                 ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>
#include <tuple>

#ifdef _MSC_VER
#include <agents.h>
#endif

#define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define REV(v) rbegin(v), rend(v)
#define MEMSET(v, s) memset(v, s, sizeof(v))
#define X first
#define Y second

using namespace std;

string tree(const string &s, int &pos){
	string chl, chr;
	++pos;
	if (s[pos] == '(') chl = tree(s, pos);
	++pos;
	if (s[pos] == '(') chr = tree(s, pos);
	++pos;
	return "(" + chl + "," + chr + ")";
}

char c;
string a, b;
int p1, p2;

string and(){
	++p1, ++p2;

	string chl, chr;
	if (a[p1] == '(' && b[p2] == '('){
		chl = and();
	}
	else if (a[p1] == '('){
		tree(a, p1);
	}
	else if (b[p2] == '('){
		tree(b, p2);
	}

	++p1, ++p2;

	if (a[p1] == '(' && b[p2] == '('){
		chr = and();
	}
	else if (a[p1] == '('){
		tree(a, p1);
	}
	else if (b[p2] == '('){
		tree(b, p2);
	}

	++p1, ++p2;

	return "(" + chl + "," + chr + ")";
}

string or(){
	++p1, ++p2;

	string chl, chr;
	if (a[p1] == '(' && b[p2] == '('){
		chl = or();
	}
	else if (a[p1] == '('){
		chl = tree(a, p1);
	}
	else if (b[p2] == '('){
		chl = tree(b, p2);
	}

	++p1, ++p2;

	if (a[p1] == '(' && b[p2] == '('){
		chr = and();
	}
	else if (a[p1] == '('){
		chr = tree(a, p1);
	}
	else if (b[p2] == '('){
		chr = tree(b, p2);
	}

	++p1, ++p2;

	return "(" + chl + "," + chr + ")";
}

int main(){
	while (cin >> c >> a >> b){
		p1 = p2 = 0;

		if (c == 'i') cout << and() << endl;
		else cout << or() << endl;
	}

	return 0;
}

Compiler output:
a.cc:46:12: error: expected unqualified-id before ')' token
   46 | string and(){
      |            ^
a.cc:77:8: error: expected unqualified-id before 'or' token
   77 | string or(){
      |        ^~
a.cc: In function 'int main()':
a.cc:112:42: error: expected identifier before '(' token
  112 |                 if (c == 'i') cout << and() << endl;
      |                                          ^
a.cc:113:30: error: expected primary-expression before 'or' token
  113 |                 else cout << or() << endl;
      |                              ^~
a.cc:113:33: error: expected primary-expression before ')' token
  113 |                 else cout << or() << endl;
      |                                 ^
Language: C++

#include "set>.cpp"
#include "set>.cpp"
#include <iostream>
template<class T>class L{L<T*>operator->()};L<int>i=i->

int main(){
 while(1){
}
}

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

char str[99999];
int main()
{
    int t,i,j,k;
    scanf("%d", &t);
 
    for(i=0;i<t;i++){
        int n;
        scanf("%d%s", &n,s);
 
        int a[2] = {0};
        for(j=0;j<2;j++){
            for(k=0;k<n*2;k++){
                if(str[j*2*n+k] == 'Y'){
                    a[j]++;
                    k += k%2;
                }
            }
        }
 
        printf("%d\n", n+max(a[0], 2)+a[1]);
    }
 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |     scanf("%d", &t);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | char str[99999];
main.c:5:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |     scanf("%d", &t);
      |     ^~~~~
main.c:5:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:9:26: error: 's' undeclared (first use in this function)
    9 |         scanf("%d%s", &n,s);
      |                          ^
main.c:9:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   21 |         printf("%d\n", n+max(a[0], 2)+a[1]);
      |         ^~~~~~
main.c:21:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:21:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:26: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
   21 |         printf("%d\n", n+max(a[0], 2)+a[1]);
      |                          ^~~
Language: C

char str[99999];
int main()
{
    int t,i,j,k;
    scanf("%d", &t);
 
    for(i=0;i<t;i++){
        int n;
        scanf("%d%s", &n,str);
 
        int a[2] = {0};
        for(j=0;j<2;j++){
            for(k=0;k<n*2;k++){
                if(str[j*2*n+k] == 'Y'){
                    a[j]++;
                    k += k%2;
                }
            }
        }
 
        printf("%d\n", n+max(a[0], 2)+a[1]);
    }
 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |     scanf("%d", &t);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | char str[99999];
main.c:5:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |     scanf("%d", &t);
      |     ^~~~~
main.c:5:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:21:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   21 |         printf("%d\n", n+max(a[0], 2)+a[1]);
      |         ^~~~~~
main.c:21:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:21:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:26: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
   21 |         printf("%d\n", n+max(a[0], 2)+a[1]);
      |                          ^~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <math.h>
using namespace std;

int min( int a, int b)
{
	return a>b?b:a;
}

#define MAXN 10000

bool exist[MAXN*4+10];
int cost[MAXN+10][4];
char s[4*MAXN+10];

int solve()
{
	int n;
	scanf("%d",&n);
	if( n<= 0)
		return 0;

	gets(s+1);
	gets(s+1);
	memset(exist,false,sizeof(exist));

	for( int i = 1; i <= 4*n ; i++ )
	{
		if( s[i]=='Y' || s[i]=='y' )
		{
			exist[i] = true;
		}
	}

	memset(cost,0,sizeof(cost));

	if( exist[1] )
	{
		if( exist[2*n+1] )
		{
			cost[1][0] = 3;
			cost[1][1] = 2;
			cost[1][2] = 2;
		}
		else
		{
			cost[1][0] = 1;
			cost[1][1] = 1;
			cost[1][2] = 2;
		}
	}
	else
	{
		if( exist[2*n+1] )
		{
			cost[1][0] = 3;
			cost[1][1] = 2;
			cost[1][2] = 2;
		}
		else
		{
			cost[1][0] = 0;
			cost[1][1] = 1;
			cost[1][2] = 2;
		}
	}

	for( int j = 2; j <=n+1 ; j++ )
	{
		if( (exist[((j-1)<<1)] | exist[((j-1)<<1)+1]) )
		{
			if( exist[((n+j-1)<<1)] | exist[((n+j-1)<<1)+1] )
			{
				cost[j][0] = min(min(cost[j-1][0]+4, cost[j-1][1]+3),cost[j-1][2]+3);
				cost[j][1] = min(min(cost[j-1][0]+3, cost[j-1][1]+3),cost[j-1][2]+3);
				cost[j][2] = min(min(cost[j-1][0]+3, cost[j-1][1]+3),cost[j-1][2]+4);
	//			printf(" %d,%d,%d,%d",(j-1)<<1,((j-1)<<1)+1,(n+j-1)<<1,((n+j-1)<<1)+1);
	//		puts("(11)");
			}
			else
			{
				cost[j][0] = min(min(cost[j-1][0]+2, cost[j-1][1]+2),cost[j-1][2]+3);
				cost[j][1] = min(min(cost[j-1][0]+2, cost[j-1][1]+2),cost[j-1][2]+3);
				cost[j][2] = min(min(cost[j-1][0]+3, cost[j-1][1]+3),cost[j-1][2]+4);
	//			puts("(10)");
			}
		}
		else
		{
			if( exist[((n+j-1)<<1)] | exist[((n+j-1)<<1)+1] )
			{
				cost[j][0] = min(min(cost[j-1][0]+4, cost[j-1][1]+3),cost[j-1][2]+3);
				cost[j][1] = min(min(cost[j-1][0]+3, cost[j-1][1]+2),cost[j-1][2]+2);
				cost[j][2] = min(min(cost[j-1][0]+3, cost[j-1][1]+2),cost[j-1][2]+2);
	//			puts("(01)");
			}
			else
			{
				cost[j][0] = min(min(cost[j-1][0]+1, cost[j-1][1]+2),cost[j-1][2]+3);
				cost[j][1] = min(min(cost[j-1][0]+2, cost[j-1][1]+1),cost[j-1][2]+2);
				cost[j][2] = min(min(cost[j-1][0]+3, cost[j-1][1]+2),cost[j-1][2]+1);
	//			puts("(00)");
			}
		}
	}

/*	for( int k = 0 ; k < 3 ; k++ )
	{
	for( int i = 1 ; i <= n+1 ; i ++ )
	{
		printf("%d  ",cost[i][k]);
	}
	puts("");
	}*/
	return cost[n+1][0];
}

int main()
{
	int t;
	scanf("%d",&t);
	while( t-- )
	{
		printf("%d\n",solve());
	}
	return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:25:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   25 |         gets(s+1);
      |         ^~~~
      |         getw
Language: Java

import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String one = ",,.,!?";
		String two = "abcABC";
		String three = "defDEF";
		String four = "ghiGHI";
		String five = "jklJKL";
		String six = "mnoMNO";
		String seven = "pqrsPQRS";
		String eight = "tuvTUV";
		String nine = "wxyzWXYZ";
		String zero = " ";
		
		while(sc.hasNext()){
			String ans = "";
			String line = sc.next();
			int n = 0;
			while(line.length() > n){
				int count = 0;
				while(n + 1 != line.length() && line.charAt(n) == line.charAt(n + 1)){
					count++;
					n++;
				}
				String temp = "";
				if(line.charAt(n) == '1')
					temp = one;
				else if(line.charAt(n) == '2')
					temp = two;
				else if(line.charAt(n) == '3')
					temp = three;
				else if(line.charAt(n) == '4')
					temp = four;
				else if(line.charAt(n) == '5')
					temp = five;
				else if(line.charAt(n) == '6')
					temp = six;
				else if(line.charAt(n) == '7')
					temp = seven;
				else if(line.charAt(n) == '8')
					temp = eight;
				else if(line.charAt(n) == '9')
					temp = nine;
				else if(line.charAt(n) == '0')
					temp = zero;
				if(temp == zero){
					if(count >= 1){
						for(int k = 0; k < count; k++){
							ans += " ";
						}
					}
				}else{
					ans += temp.charAt(count % temp.length());
				}
				n++;
			}
			System.out.println(ans);
		}
	}

}

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

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

#define LL long long
#define xx first
#define yy second
#define NL '\n'
#define mp make_pair
#define pb push_back
#define FOR(i,j,k) for(i=j;i<=k;i++)
#define REV(i,j,k) for(i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define MOD 1000000007
#define MAX 100005

int main()
{
    std::ios_base::sync_with_stdio(0);
    int cases,len,caseno=0,n,i,j,k,cnt,sum;
    char ch;
    string s;
    string p[]={" ", "',.!?", "abcABC", "defDEF", "ghiGHI", "jklJKL", "mnoMNO", "pqrsPQRS", "tuvTUV", "wxyzWXYZ"};

    while(cin >> s)
    {
        len = s.size();

        ch = s[0];
        k = 0;

        FOR(i,1,len-1)
        {
            if(ch == s[i])
                k++;
            else
            {
                if(ch == '0')
                {
                    FOR(j,1,k) cout << " ";
                }
                else
                    cout << p[(int)(ch-'0')][k];

                ch = s[i];
                k = 0;
            }
        }

        if(ch == '0')
                {
                    FOR(j,1,k) cout << " ";
                }
                else
                    cout << p[(int)(ch-'0')][k];

        cout << NL;



    }


    return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <string>

using namespace std;

int num[9] = {5,3,3,3,3,3,4,3,4};
char one[5] = {'\'', ',', '.', '!', '?'};
char lower[8] = {'a', 'd', 'g', 'j', 'm', 'p', 't', 'w'};
char upper[8] = {'A', 'D', 'G', 'J', 'M', 'P', 'T', 'W'};
int main(){
    string str;
    while(cin >> str){
        char tmp=-1;
        int cnt = 0;
        for(int i=0;i<str.size()+1;i++){
            if(i != str.size() && (tmp == -1 || tmp == str[i])){
                tmp = str[i];
                cnt++;
            }else{
                int div,index;
                if(tmp != '0'){
                    div = (cnt-1)/num[tmp-'1'];
                    index = (cnt-1)%num[tmp-'1'];
                }
                if(tmp == '1'){
                    cout << one[index];
                }else if('2' <= tmp && tmp <= '9'){
                    if(div % 2){
                        cout << (char)(upper[tmp - '2'] + index);
                    }else{
                        cout << (char)(lower[tmp - '2'] + index);
                    }
                }else{
                    for(int j=0;j<cnt-1;j++){
                        cout << " ";
                    }
                }
                tmp = str[i];
                cnt = 1;
            }
        }
        cout << endl;
    }
} 

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

char *t[]={"',.!?","abcABC","defDEF","ghiGHI","jklJKL","mnoMNO","pqrsPQRS","tuvTUV","wxyzWXYZ"};
main(x,c,d){
  for(d=-1,x=-1;~(c=getchar());)
    if(c=='\n'){
      if(d)put();puts(""),d=-1,x=-1;
    }else if(c-=48){
      if(c==d)x++;
      else if(~x)put(),x=0;
      if(d==-1)x=0;
      d=c;
    }else{
      if(~d&&d)put(),x=-1;
      else putchar(' ');
      d=-1;
    }
  return 0;
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(x,c,d){
      | ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:3:21: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration]
    3 |   for(d=-1,x=-1;~(c=getchar());)
      |                     ^~~~~~~
main.c:1:1: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | char *t[]={"',.!?","abcABC","defDEF","ghiGHI","jklJKL","mnoMNO","pqrsPQRS","tuvTUV","wxyzWXYZ"};
main.c:5:12: error: implicit declaration of function 'put' [-Wimplicit-function-declaration]
    5 |       if(d)put();puts(""),d=-1,x=-1;
      |            ^~~
main.c:5:18: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    5 |       if(d)put();puts(""),d=-1,x=-1;
      |                  ^~~~
main.c:5:18: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:13:12: error: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
   13 |       else putchar(' ');
      |            ^~~~~~~
main.c:13:12: note: include '<stdio.h>' or provide a declaration of 'putchar'
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cmath>
#include <cassert>
using namespace std;

const char* table[] = {
  NULL,
  "',.!?",
  "abcABC",
  "defDEF",
  "ghiGHI",
  "jklJKL",
  "mnoMNO",
  "pqrsPQRS",
  "tuvTUV",
  "wxyzWXYZ",
};

int main()
{
  string str;

    str += '\0';
    char prev = 0;
    int row = 0, col = 0;
    for (int i = 0; i < (int)str.size(); ++i) {
      int n = str[i] - '0';
      if (n == 0) {
        if (prev == 0) {
          cout << ' ';
        } else {
          cout << table[row][col];
        }
      } else {
        if (n != prev) {
          if (prev != 0) { cout << table[row][col]; }
          row = n; col = 0;
        } else {
          ++col;
          if (table[row][col] == '\0') { col = 0; }
        }
      }
      prev = n;
    }
    cout << endl;
  }
}

Compiler output:
a.cc:55:1: error: expected declaration before '}' token
   55 | }
      | ^
Language: Java

public class Main {
    public static void main(String[] args) throws NumberFormatException, IOException {
    	InputStreamReader ir = new InputStreamReader(System.in);
        BufferedReader in = new BufferedReader(ir);
			while(true){
				String bString=in.readLine();
				if(bString.length()==0||bString==null||bString=="") break;
				int xiao_case=Integer.valueOf(bString);
				printPrimes(xiao_case);
			}
    	
	}

public static void printPrimes(int n){
    	int c=0;
    	if ( n <= 1)
    	return;
    	int all[] = new int[n+1];
    	for (int i = 0; i <= n; i++){
    	all[i] = i;
    	}

    	int prime[] = new int[n+1];
    	for (int i = 0; i <= n; i++)
    	prime[i] = 1;

    	int x = 2;
    	while (x <= n){
    	if (prime[x] == 1){
    	   if(checkPrime(n-x+1)) c++;
    	   for (int j = 1; j * x <=n; j++)
    	      prime[j*x] = 0;
    	}
    	x++;
    	}
    	System.out.println(c);
    } 
    public static boolean checkPrime(int n){
    	 if(n < 2) return false;
    	    if(n == 2 || n == 3) return true;
    	    if(n%2 == 0 || n%3 == 0) return false;
    	    long sqrtN = (long)Math.sqrt(n)+1;
    	    for(long i = 6L; i <= sqrtN; i += 6) {
    	        if(n%(i-1) == 0 || n%(i+1) == 0) return false;
    	    }
    	    return true;
    }
}

Compiler output:
Main.java:2: error: cannot find symbol
    public static void main(String[] args) throws NumberFormatException, IOException {
                                                                         ^
  symbol:   class IOException
  location: class Main
Main.java:3: error: cannot find symbol
    	InputStreamReader ir = new InputStreamReader(System.in);
    	^
  symbol:   class InputStreamReader
  location: class Main
Main.java:3: error: cannot find symbol
    	InputStreamReader ir = new InputStreamReader(System.in);
    	                           ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:4: error: cannot find symbol
        BufferedReader in = new BufferedReader(ir);
        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
        BufferedReader in = new BufferedReader(ir);
                                ^
  symbol:   class BufferedReader
  location: class Main
5 errors
Language: C

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <vector>
#include <list>
#include <math.h>
#include <algorithm>
using namespace std;

pair<int, int> pii[10005];
int N, answer;
bool isPrime(int n) {
    if (n == 1) return 0;
    if (n == 2) return 1;
    for (int i = 2; i <= sqrt(n); i ++)
        if (n % i == 0) return false;
    return true;
}
int main() {
    while (scanf("%d", &N) != EOF) {
        answer = 0;
        for (int i = 1; i <= N; i ++) {
            pii[i].first = i;
            pii[i].second = N - i + 1;
        }
        for (int i = 1; i <= N; i ++) {
            if (isPrime(pii[i].first) && isPrime(pii[i].second))
                answer ++;
        }
        printf("%d\n", answer);
    }
    return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <math.h>

struct Pair {
    int first;
    int second;
};
Pair pii[10005];
int N, answer;
bool isPrime(int n) {
    if (n == 1) return 0;
    if (n == 2) return 1;
    for (int i = 2; i <= sqrt(n); i ++)
        if (n % i == 0) return false;
    return true;
}
int main() {
    while (scanf("%d", &N) != EOF) {
        answer = 0;
        for (int i = 1; i <= N; i ++) {
            pii[i].first = i;
            pii[i].second = N - i + 1;
        }
        for (int i = 1; i <= N; i ++) {
            if (isPrime(pii[i].first) && isPrime(pii[i].second))
                answer ++;
        }
        printf("%d\n", answer);
    }
    return 0;
}

Compiler output:
main.c:8:1: error: unknown type name 'Pair'; use 'struct' keyword to refer to the type
    8 | Pair pii[10005];
      | ^~~~
      | struct 
main.c:10:1: error: unknown type name 'bool'
   10 | bool isPrime(int n) {
      | ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <math.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c: In function 'isPrime':
main.c:14:32: error: 'false' undeclared (first use in this function)
   14 |         if (n % i == 0) return false;
      |                                ^~~~~
main.c:14:32: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:14:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:12: error: 'true' undeclared (first use in this function)
   15 |     return true;
      |            ^~~~
main.c:15:12: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:21:19: error: request for member 'first' in something not a structure or union
   21 |             pii[i].first = i;
      |                   ^
main.c:22:19: error: request for member 'second' in something not a structure or union
   22 |             pii[i].second = N - i + 1;
      |                   ^
main.c:25:31: error: request for member 'first' in something not a structure or union
   25 |             if (isPrime(pii[i].first) && isPrime(pii[i].second))
      |                               ^
main.c:25:56: error: request for member 'second' in something not a structure or union
   25 |             if (isPrime(pii[i].first) && isPrime(pii[i].second))
      |                                                        ^