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

import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
  String s = sc.next();
  while(str.contains("B")){
    int idx = str.indexOf("B");
    s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1);
  }
  System.out.println(s);
}}


Compiler output:
Main.java:6: error: cannot find symbol
  while(str.contains("B")){
        ^
  symbol:   variable str
  location: class Main
Main.java:7: error: cannot find symbol
    int idx = str.indexOf("B");
              ^
  symbol:   variable str
  location: class Main
2 errors
Language: C++

#include <iostream>
using namespace std;

int main(){
	string S, A;
	for(int i=0; i<10; i++){
		char x;
		cin >> x;
		if(x=='0'){
			A += "0";
		} else if(x=='1'){
			A += "1";
		} else if(x=='B'){
			if(A.size()>0){
				A.size()--;
			}
		}
	}
	cout << A << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:39: error: lvalue required as decrement operand
   15 |                                 A.size()--;
      |                                 ~~~~~~^~
Language: C++

#include <iostream>
using namespace std;

int main(){
	string S, A;
	for(int i=0; i<10; i++){
		char x;
		cin >> x;
		if(x=='0'){
			A += "0";
		} else if(x=='1'){
			A += "1";
		} else if(x=='B'){
			A -= ""
		}
	}
	cout << A << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [1]')
   14 |                         A -= ""
      |                         ~~^~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	string S, A;
	for(int i=0; i<10; i++){
		char x;
		cin >> x;
		if(x=='0'){
			A += "0";
		} else if(x=='1'){
			A += "1";
		} else if(x=='B'){
			*(A.end()-1) = '';
		}
	}
	cout << A << endl;
}

Compiler output:
a.cc:14:40: error: empty character constant
   14 |                         *(A.end()-1) = '';
      |                                        ^~
Language: C++

#include <iostream>
using namespace std;

int main(){
	string S, A;
	for(int i=0; i<10; i++){
		char x;
		cin >> x;
		if(x=='0'){
			A += "0";
		} else if(x=='1'){
			A += "1";
		} else if(x=='B'){
			*A.end() = '';
		}
	}
	cout << A << endl;
}

Compiler output:
a.cc:14:36: error: empty character constant
   14 |                         *A.end() = '';
      |                                    ^~
Language: C++

#include <iostream>
using namespace std;

int main(){
	string S, A;
	for(int i=0; i<10; i++){
		char x;
		cin >> x;
		if(x=='0'){
			A += "0";
		} else if(x=='1'){
			A += "1";
		} else if(x=='B'){
			*A.end() = "";
		}
	}
	cout << A << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:36: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   14 |                         *A.end() = "";
      |                                    ^~
      |                                    |
      |                                    const char*
Language: C++

#include <iostream>
using namespace std;

int main(){
	string S, A;
	for(int i=0; i<10; i++){
		char x;
		cin >> x;
		if(x=='0'){
			A += "0";
		} else if(x=='1'){
			a += "1";
		} else if(x=='B'){
			if(A.size()!=0){
				A -= *A.end();
			}
		}
	}
	cout << A << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: 'a' was not declared in this scope
   12 |                         a += "1";
      |                         ^
a.cc:15:35: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
   15 |                                 A -= *A.end();
      |                                 ~~^~~~~~~~~~~
Language: C++

#include<iostream>

using namespace std;

int main(){

    char  s[] ;
    cin >> s ;
    int i = 0;
    char out[sizeof(s)];
    int j = 0;

    for (i = 0; i <= sizeof(s); i++){
        
        if (s[i] == '0') {
            out[j] += '0';
            j++;
        }
        else if (s[i] == '1'){ 
            out[j] += '1';
            j++;
        }
        
        if (s[i]== 'B') {
            
            if (j > 0){
                out[j-1] = '\0';
                j--;
            
            }
        }
    }
    

    cout << out << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: storage size of 's' isn't known
    7 |     char  s[] ;
      |           ^
a.cc:16:13: error: 'out' was not declared in this scope
   16 |             out[j] += '0';
      |             ^~~
a.cc:20:13: error: 'out' was not declared in this scope
   20 |             out[j] += '1';
      |             ^~~
a.cc:27:17: error: 'out' was not declared in this scope
   27 |                 out[j-1] = '\0';
      |                 ^~~
a.cc:35:13: error: 'out' was not declared in this scope
   35 |     cout << out << endl;
      |             ^~~
Language: C++

s = input()
ans = []

for ch in s:
    if ch == '0':
        ans.append('0')
    elif ch == '1':
        ans.append('1')
    else:
        if len(ans) != 0:
            ans.pop()

print("".join(ans))

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = input()
      | ^
Language: C++

// inputに入力データ全体が入る
function Main(input) {
	ans = [];
	for(let i=0;i<input.length;i++){
		if(input[i] == 'B') ans.pop();
		else ans.push(input[i]);
	}
	console.log(ans.join(''));
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Compiler output:
a.cc:8:30: error: empty character constant
    8 |         console.log(ans.join(''));
      |                              ^~
a.cc:2:1: error: 'function' does not name a type; did you mean 'union'?
    2 | function Main(input) {
      | ^~~~~~~~
      | union
a.cc:11:5: error: expected constructor, destructor, or type conversion before '(' token
   11 | Main(require("fs").readFileSync("/dev/stdin", "utf8"));
      |     ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>

int main() {
	std::string s, ans;
	std::cin >> s;
	for (int i = 0;i < s.size();i++) {
		if (s[i] == '0') {
			ans.push_back('0');
		}
		else if (s[i] == '1') {
			ans.push_back('1');
		}
		else{ 
			if(!ans.empty)
				ans.pop_back();
		}
	}
	std::cout << ans << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: cannot convert 'std::__cxx11::basic_string<char>::empty' from type 'bool (std::__cxx11::basic_string<char>::)() const noexcept' to type 'bool'
   20 |                         if(!ans.empty)
      |                                 ^~~~~
a.cc:20:33: error: in argument to unary !
   20 |                         if(!ans.empty)
      |                             ~~~~^~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<functional>
#include<stack>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

#define DBG cerr << '!' << endl;
#define REP(i,n) for(int (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(int (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(int (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int i = 0;i < (n);i++)cerr << v[i] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)

using namespace std;

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

char mp[100];

int main()
{
	string str;cin >> str;
	int now = 0;
	REP(i,str.size())
	{
		if(sre[i] == 'B' && now > 0)now--;
		else
		{
			[now] = str[i];
			now++;
		}
	}
	
	REP(i,now)
	{
		cout << mp[i];
	}cout << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:20: error: 'sre' was not declared in this scope
   49 |                 if(sre[i] == 'B' && now > 0)now--;
      |                    ^~~
a.cc: In lambda function:
a.cc:52:31: error: expected '{' before '=' token
   52 |                         [now] = str[i];
      |                               ^
a.cc: In function 'int main()':
a.cc:52:38: error: no match for 'operator=' (operand types are 'main()::<lambda()>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
   52 |                         [now] = str[i];
      |                                      ^
a.cc:52:29: note: candidate: 'main()::<lambda()>& main()::<lambda()>::operator=(const main()::<lambda()>&)' (deleted)
   52 |                         [now] = str[i];
      |                             ^
a.cc:52:29: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const main()::<lambda()>&'
Language: C++

// glory be to the sky
#include<cstdio>
#include<bits/stdc++.h> 
using namespace std;
	
typedef long long ll; 

int main(){

	ios::sync_with_stdio(false);
	cin.tie(0);
	string input;
	vector<char> output;
	cin >> input;
	for (int i = 0; i < input.length(); i++) {
		if (input[i] == '0') output.pb('0');
		else if (input[i] == '1') output.pb('1');
		else if (output.size()) output.pop_back(); 
	}
	for (int i = 0; i < output.size(); i++) cout << output[i];
	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:45: error: 'class std::vector<char>' has no member named 'pb'
   16 |                 if (input[i] == '0') output.pb('0');
      |                                             ^~
a.cc:17:50: error: 'class std::vector<char>' has no member named 'pb'
   17 |                 else if (input[i] == '1') output.pb('1');
      |                                                  ^~
Language: C

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<queue>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<cmath>
#include<cctype>
#include<ctime>
#define pi acos(-1.0)
using namespace std;

 int main()
 {
     string a;
     cin>>a;
     int len=a.length();
     stack <char> q ;
     for(int i=0;i<len;i++){
         if(a[i]=='1'){
             q.push('1');
         }
         else if(a[i]=='0'){
             q.push('0');
         }
         else if(a[i]=='B'){
             if(q.size()>0)
                 q.pop();
         }
     }
     while(q.size()>0){
         cout<<q.top();
         q.pop();
     }
     cout<<endl;
     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<cstring>
#include<vector>
#include<stack> 
#include<cstdio>
using namespace std;
char a[50],b[50];
int main()
{
	vector<char>q;
	while(cin>>a)
	{
		int len=a.size();
		for(int i=0;i<len;i++)
		{
			if(a[i]=='0')
				q.push_back('0');
			else if(a[i]=='1')
				q.push_back('1');
			else if(!q.empty())	
				q.pop_back();
		}
		int j=q.size();
		for(int i=0;i<j;i++)
		{
			cout<<b[i];
		}
		cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: request for member 'size' in 'a', which is of non-class type 'char [50]'
   13 |                 int len=a.size();
      |                           ^~~~
Language: C++

#include<iostream>
#include<cstring>
#include<vextor>
#include<stack> 
#include<cstdio>
using namespace std;
char a[50],b[50];
int main()
{
	vector<char>q;
	while(cin>>a)
	{
		int len=a.size();
		for(int i=0;i<len;i++)
		{
			if(a[i]=='0')
				q.push_back('0');
			else if(a[i]=='1')
				q.push_back('1');
			else if(!q.empty())	
				q.pop_back();
		}
		int j=q.size();
		for(int i=0;i<j;i++)
		{
			cout<<b[i];
		}
		cout<<endl;
	}
	return 0;
}

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

#include<iostream>
using namespace std;
#include<cstring>
#include<cstdio> 
int a[20];
char s[20];
int main()
{
	gets(s);
//	puts(s);
    int k=-1;
	for(int i=0;i<strlen(s);i++)
	{
	
	if(s[i]=='0')
	{
	k++;
	a[k]=0;	
	}
	if(s[i]=='1')
	{
	k++;
	a[k]=1;
	}
	if(s[i]=='B')
	if(k>=0)
	k--; 
		
	}
	for(int i=0;i<=k;i++)
	{
		cout<<a[i];
	}
	return 0;
}

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

#include<iostream>
using namespace std;
#include<cstring>
int a[20];
char s[20];
int main()
{
	gets(s);
//	puts(s);
    int k=-1;
	for(int i=0;i<strlen(s);i++)
	{
	
	if(s[i]=='0')
	{
	k++;
	a[k]=0;	
	}
	if(s[i]=='1')
	{
	k++;
	a[k]=1;
	}
	if(s[i]=='B')
	if(k>=0)
	k--; 
		
	}
	for(int i=0;i<=k;i++)
	{
		cout<<a[i];
	}
	return 0;
}

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

#include"stdio.h"
#include"cstdio"
#include"algorithm"
#include"string.h"
using namespace std;
const int max_n=1e4+10;
char A[max_n];
char S[50]; 
int main()
{
	while(gets(A)!=NULL)
	{
		int i,k=-1,n=strlen(A);
		memset(S,0,sizeof(S));
		for(i=0;i<n;i++)
		{
			if(A[i]=='0')
			{
				S[++k]='0';
			}
			if(A[i]=='1')
			{
				S[++k]='1';	
			}
			if(A[i]=='B')
			{
				if(strlen(S))
				S[k--]=0;
			}
		}
		printf("%s\n",S);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
   11 |         while(gets(A)!=NULL)
      |               ^~~~
      |               getw
Language: C++

#include<cstring>
#include<cstdio>
using namespace std;
int main()
{
    char s[15],a[15];
    gets(s);
    int len =strlen(s);
    int l=0;
    for(int i=0;i<len ;i++)
    {
        if(s[i]=='0'||s[i]=='1')
        a[l++]=s[i];
        if(s[i]=='B'&&l>=1)
            l--;
    }
    for(int i=0;i<l;i++)
    printf("%c",a[i]);
    printf("\n");
    return 0;
}


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

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>

using namespace std;

int main()
{
    string s;
    while(cin>>s)
    {
        for(int i=0;i<s.size();i++)
        {
            if(s[i]=='0')
            {
                ch.push_back('0');
            }
            else if(s[i]=='1')
            {
                ch.push_back('1');
            }
            else if(!ch.empty())
            {
                ch.pop_back();
            }
        }
        for(int i=0;i<ch.size();i++)
        {
            cout<<ch[i];
        }
        cout<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'ch' was not declared in this scope
   17 |                 ch.push_back('0');
      |                 ^~
a.cc:21:17: error: 'ch' was not declared in this scope
   21 |                 ch.push_back('1');
      |                 ^~
a.cc:23:22: error: 'ch' was not declared in this scope
   23 |             else if(!ch.empty())
      |                      ^~
a.cc:28:23: error: 'ch' was not declared in this scope
   28 |         for(int i=0;i<ch.size();i++)
      |                       ^~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main() {
	string s, str="";
	cin >> s;
	for (int i = 0;i < s.size();i++) {
		if ((s[i]=='0'||s[i]=='1') {
			str += s[i];
		}
		else {
			str = str.substr(0, str.size() - 1);
		}
	}
		cout << str << endl;
		return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:43: error: expected ')' before '{' token
    8 |                 if ((s[i]=='0'||s[i]=='1') {
      |                    ~                      ^~
      |                                           )
a.cc:14:9: error: expected primary-expression before '}' token
   14 |         }
      |         ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main() {
	string s, str;
	cin >> s;
	for (int i = 0;i < s.size();i++) {
		if ((s[i] == 0) || (s[i] == 1)) {
			str += s[i];
		}
		else
			str = str.substr(0, str.size()-1);
	cout << str << endl;
		return 0;
}

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

#include <stdio.h>
#include <conio.h>

int main(){
	char S[11];
	char A[11]={};
	int x=0;

	scanf("%s",&S);
	for(int i=0;i<11;i++){
		if(S[i]=='0'){
			A[x]='0';
			x++;
		}
		else if(S[i]=='1'){
			A[x]='1';
			x++;
		}
		else if(S[i]=='B'){
			if(x!=0)
				x--;
		}

	}
	for(int i=0;i<x;i++){
		printf("%c",A[i]);
	}
	printf("\n");
	getch();
}

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

#include <cstdio>
#ifdef _MSC_VER
#include <conio.h>
#else
#define getch()
#endif
#include <string>
#include <queue>

using std::string;
using std::queue;

int main(){
	queue<char> Input;
	string Str="";
	char Buf[11]="";
	scanf("%s",Buf);
	for(int i=0;i<strlen(Buf);i++){
		Input.push(Buf[i]);
	}
	while(Input.empty()!=true){
		char Top=Input.front();
		Input.pop();
		switch(Top){
		case '0':
			//printf("Pushed 0\n");
			Str.push_back('0');
			break;
		case '1':
			//printf("Pushed 1\n");
			Str.push_back('1');
			break;
		case 'B':
			if(Str.empty()!=true){
				//printf("Erased\n");
				Str.erase(Str.size()-1);
			}
			break;
		}
	}
	printf("%s\n",Str.c_str());
	getch();
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: 'strlen' was not declared in this scope
   18 |         for(int i=0;i<strlen(Buf);i++){
      |                       ^~~~~~
a.cc:9:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <queue>
  +++ |+#include <cstring>
    9 |
Language: C++

//ABC043B
 
#include <iostream>
#include <string>
#include <stack>
#include <list>
#include <algorithm>
 
using namespace std;
 
int main(){
    string s;
    list<char> st;
    cin>>s;
 
    for(int i=0;i<s.size();i++){
        if(s[i]=='0'||s[i]=='1'){
            st.push_back(s[i]);
        }else if(s[i]=='B'){
            if(!st.empty()){
                st.pop_back();
            }
        }
    }
    for(int i=0;i<st.size();i++){
            cout<<st.front();
            st.pop.front();
    }
 
    cout<<endl;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:16: error: 'class std::__cxx11::list<char>' has no member named 'pop'
   27 |             st.pop.front();
      |                ^~~
Language: C++

package main

import (
  "fmt"
)

func main(){
  var b string
  fmt.Scan(&b)

  var out []rune
  for _,v := range b {
    switch v {
    case 'B':
      if len(out) > 0 {
        out = out[:len(out) - 1]
      }
      default:
        out = append(out, v)
    }
  }
  fmt.Println(string(out))
}

Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		String S=s.next();
		boolean f[]=new boolean[S.length()];
		int i=0;
		
		
		for(i=0;i<S.length();i++){
			f[i]=true;
			if(S.charAt(i)=='B'){
				f[i-1]=false;
				f[i]=false;
			}
		}
		for(i=0;i<S.length();i++){
			if(f[i]==true)System.out.print(S.charAt(i));
		}
		

	}

}


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

#include<iostream>
#include<string>
using namespace std;
int main(){
	string s; cin >> s;
	string str;
	for (int i = 0; i < s.size(); i++){
		if (s[i] == '0')str += '0';
		else if (s[i] == '1')str += '1';
		else if (s[i] == 'B'&&s.size != 0)s.pop_back();
	}
	cout << str << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:41: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   10 |                 else if (s[i] == 'B'&&s.size != 0)s.pop_back();
      |                                       ~~^~~~
      |                                             ()
Language: C++

#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	string s;
	cin>>s;
	stirng ans = "";
	rep(i,s.size()){
		if(s[i]=='B'){
			if(ans.size()==0){
				continue;
			}
			else{
				ans = ans.substr(0,ans.size()-1);
			}
		}
		else{
			ans += s[i];
		}
	}
	cout<<ans<<endl;
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

Compiler output:
a.cc: In function 'void mainmain()':
a.cc:100:9: error: 'stirng' was not declared in this scope
  100 |         stirng ans = "";
      |         ^~~~~~
a.cc:103:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
  103 |                         if(ans.size()==0){
      |                            ^~~
      |                            abs
a.cc:111:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
  111 |                         ans += s[i];
      |                         ^~~
      |                         abs
a.cc:114:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
  114 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: Java

public class Main {
        
    public static void main(String Args[]){                       
        
       Scanner sc=new Scanner(System.in);
          
       String str = sc.next();
       
       StringBuffer sb1 = new StringBuffer();
       
       char []hoge = str.toCharArray();
       
       for(char ch:hoge){
           if(ch == '0'){
              sb1.append(0);
           }
           if(ch == '1'){
              sb1.append(1);
           }
           if(ch == 'B'){
               if(sb1.length() > 0){
                  sb1.delete(sb1.length()-1,sb1.length());
               }
           }   
       }                            
       
       
       System.out.println(sb1);
    }

}

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

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
const long long INF = LLONG_MAX / 2;
#define FOR(i, r, n) for(int i=(r); i<(n); i++) 
#define REP(i, n) FOR(i, (0), n)
#define ll long long int
template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
	vector.erase(vector.begin() + index);
}

using namespace std;
ll ans = 0, sum = 0, n, k, t;
string s;

vector<ll> v;

int main() {
	cin >> s;
	REP(i, s.size()) {
		if (s[i] == '0') {
			v.push_back(0);
		}
		else if (s[i] == '1') {
			v.push_back(1);
		}
		else if (s[i] == 'B') {
			if (v.size()) {
				v.pop_back();
			}
		}
	}
	REP(i, v.size()) {
		cout << v[i];
	}
	cout << endl;
}

Compiler output:
a.cc:7:23: error: 'LLONG_MAX' was not declared in this scope
    7 | const long long INF = LLONG_MAX / 2;
      |                       ^~~~~~~~~
a.cc:7:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <vector>
  +++ |+#include <climits>
    7 | const long long INF = LLONG_MAX / 2;
Language: Java

import java.util.Scanner;

public class Hacking {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		String str = scanner.nextLine();
		String str2 = "";
		for(char c : str.toCharArray()){
			if(c == 'b'){
				if(!str2.equals("")){
				str2 = str2.substring(0,str2.length()-1);
				}
			}
			else{
				str2 += c;
			}
		}
		System.out.println(str2);
	}

}


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

#include <iostream>
#include <stack>

using namespace std;

int main() {
string s;
string st;
cin >> s;
for (auto i = s.begin(); i != s.end(); i++) {
if (*i=='B') st.pop_back();
else st.push_back(*i)
}
cout << st << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected ';' before '}' token
   12 | else st.push_back(*i)
      |                      ^
      |                      ;
   13 | }
      | ~
Language: C++

#include <iostream>
#include <stack>

using namespace std;

int main() {
string s;
string st
cin >> s;
for (auto i = s.begin(); i != s.end(); i++) {
if (*i=='B') st.pop_back();
else st.push_back(*i)
}
cout << st << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:1: error: expected initializer before 'cin'
    9 | cin >> s;
      | ^~~
a.cc:11:14: error: 'st' was not declared in this scope; did you mean 's'?
   11 | if (*i=='B') st.pop_back();
      |              ^~
      |              s
a.cc:12:6: error: 'st' was not declared in this scope; did you mean 's'?
   12 | else st.push_back(*i)
      |      ^~
      |      s
a.cc:14:9: error: 'st' was not declared in this scope; did you mean 's'?
   14 | cout << st << endl;
      |         ^~
      |         s
Language: C

include<stdio.h>

int main(void)
{
	char S[500];
	scanf("%S",S);
	printf("%S",S);

	rewind(stdin);
	getchar();
	return 0;

}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

#define sz 12
char s[sz + 2];

int main(){

    int i, j, len;
    int p = 0;

    scanf("%s", s)

        len = strlen(s);

        if(len == 1){
            if(s[0] != 'B'){
                printf("%s\n", s);
            }
        }

        if(len > 1){
            for(i = 0; s[i]; i++){
                if(i < len - 1){
                    if(s[i + 1] != 'B' && s[i] != 'B'){
                        putchar(s[i]);
                        p = 1;
                    }
                }else if(i < len){

                    if(s[i] != 'B'){
                        putchar(s[i]);
                        p = 1;
                    }
                }
            }

            printf("\n");

        }


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: expected ';' before 'len'
   15 |     scanf("%s", s)
      |                   ^
      |                   ;
   16 | 
   17 |         len = strlen(s);
      |         ~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

#define sz 12
char s[sz + 3];

int main(){

    int i, j, len;

    gets(s);

    len = strlen(s);

    if(len == 1){

        puts(s);

    }else{

        for(i = 0; s[i]; i++){

            if(s[i + 1] != 'B' && s[i] != 'B'){

                putchar(s[i]);
            }
        }

        printf("\n");
    }

    return 0;
}


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

#include <iostream>
/* Karen {{{
  ___  ____
 |_  ||_  _|
   | |_/ /    ,--.   _ .--.  .---.  _ .--.
   |  __'.   `'_\ : [ `/'`\]/ /__\\[ `.-. |
  _| |  \ \_ // | |, | |    | \__., | | | |
 |____||____|\'-;__/[___]    '.__.'[___||__]
}}} */
/* cpp template {{{*/
/*
using namespace std;

#define endl '\n'

#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPS(i, a, n) for (int i = (a); i < (n); i++)
#define RREP(i, n) for (int i = 1; i <= (n); i++)
#define X real()
#define Y imag()
#define EQ(n,m) (abs((n)-(m)) < EPS)

typedef double D;
typedef long long ll;
typedef long double lb;
typedef complex<D> P;
typedef vector<P> VP;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<string, int> psi;

inline bool inside(int y,int x,int H,int W){return(y>=0&&x>=0&&y<H&&x<W);}
inline int in() {int x; std::cin >> x; return x;}

template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << endl;
}
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}
/* }}} */
/* 定数 {{{*/
const ll MOD = 1e9 + 7;
const ll INF = 1e9 + 9;
const D EPS  = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
/* }}} */
*/
signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  string s;
  cin >> s;

  int cnt = 0;
  for (int i = s.size(); i >= 0; i--){
    if (s[i] == 'B') cnt++;
    else if (cnt){
      s[i] = 'B';
      cnt--;
    }
  }

  REP(i, s.size()) if (s[i] != 'B') cout << s[i];
  cout << endl;

  return (0);
}



Compiler output:
a.cc:51:7: error: 'll' does not name a type
   51 | const ll MOD = 1e9 + 7;
      |       ^~
a.cc:52:7: error: 'll' does not name a type
   52 | const ll INF = 1e9 + 9;
      |       ^~
a.cc:53:7: error: 'D' does not name a type
   53 | const D EPS  = 1e-9;
      |       ^
a.cc:57:2: error: expected unqualified-id before '/' token
   57 | */
      |  ^
Language: C++

#include <bits/stdc++.h>
/* Karen {{{
  ___  ____
 |_  ||_  _|
   | |_/ /    ,--.   _ .--.  .---.  _ .--.
   |  __'.   `'_\ : [ `/'`\]/ /__\\[ `.-. |
  _| |  \ \_ // | |, | |    | \__., | | | |
 |____||____|\'-;__/[___]    '.__.'[___||__]
}}} */
/* cpp template {{{*/
using namespace std;

#define endl '\n'

#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPS(i, a, n) for (int i = (a); i < (n); i++)
#define RREP(i, n) for (int i = 1; i <= (n); i++)
#define X real()
#define Y imag()
#define EQ(n,m) (abs((n)-(m)) < EPS)

typedef double D;
typedef long long ll;
typedef long double lb;
typedef complex<D> P;
typedef vector<P> VP;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<string, int> psi;

inline bool inside(int y,int x,int H,int W){return(y>=0&&x>=0&&y<H&&x<W);}
inline int in() {int x; std::cin >> x; return x;}

template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << endl;
}
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}
/* }}} */
/* 定数 {{{*/
const ll MOD = 1e9 + 7;
const ll INF = 1e9 + 9;
const D EPS  = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
/* }}} */

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  string s;
  cin >> s;

  int cnt = 0;
  for (int i = s.size(); i >= 0; i--){
    if (s[i] == 'B') cnt++;
    else if (cnt){
      s[i] = 'B';
      cnt--;
    }
  }

  REP(i, s.size()) s[i] == 'B'?:cout << s[i];
  cout << endl;

  return (0);
}



Compiler output:
a.cc: In function 'int main()':
a.cc:74:31: error: operands to '?:' have different types 'bool' and 'std::basic_ostream<char>'
   74 |   REP(i, s.size()) s[i] == 'B'?:cout << s[i];
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int main(){
	string s;
	cin>>s;
	string out="";
	rep(i,s.size()){
		if(s[i]=="B"){
			if(out.size())out=out.substr(0,out.size()-1);
		}else{
			out+=s[i];
		}
	}
	cout<<out<<endl;
}
 
 







Compiler output:
a.cc: In function 'int main()':
a.cc:38:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   38 |                 if(s[i]=="B"){
Language: C++

#include<iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int main() {

	char str[10] = { }, ans[10] = { };
	int count = 0;
	
	cin >> str;

	for (int i = 0; i < strlen(str); i++) {
		if (str[i] == '0') 
			ans[count] = '0';
		
		else if (str[i] == '1') 
			ans[count] = '1';
		
		else {
			if (count != 0) {
				ans[count - 1] = ' ';
				count-=2;
			}
			else count--;
		}
		count++;
	}

	for (int i = 0; i <strlen(ans); i++) {
		cout << ans[i];
	}

	putchar('\n');

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: 'strlen' was not declared in this scope
   14 |         for (int i = 0; i < strlen(str); i++) {
      |                             ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | 
a.cc:31:28: error: 'strlen' was not declared in this scope
   31 |         for (int i = 0; i <strlen(ans); i++) {
      |                            ^~~~~~
a.cc:31:28: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: Java

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;


public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		Deque<Character> dq = new ArrayDeque<>();
		for(int i=0; i<s.length(); i++) {
			char c = s.charAt(i);
			if(c == 'B') {
				if(!dq.isEmpty()) dq.pop();
				continue;
			}
			dq.push(c);
		}
		while(!dq.isEmpty()) {
			System.out.print(dq.poll());
		}
		System.out.println();
	}
}

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

include <stdio.h>

int main(void)
{
	char s[10];
	char ans[10];
	int i, j;
	j = 0;


	scanf("%s", s);

	for(i=0; i<10; i++){
		if(s[i] == '0' || s[i] == '1' ){
			printf("%d\n", j);
			
			ans[j] = s[i];
			j++;
		}else if(s[i] == 'B'){
	printf("%s\n", ans);
			if(j!=0){
				ans[--j] = '\0';
			}
		}
	}

	printf("%s\n", ans);

	return 0;
}


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: Java

import java.util.*;

public class Hoge {

    public static int sum(int n){
        return (1+n)*n/2;
    }

    public static String conv(String in){
        String result = "";
        for (int i = 1; i < in.length(); i++) {
            if (in.charAt(i) != 'B') {
                result += in.charAt(i-1);
            }
        }
        if (in.charAt(in.length()-1) != 'B') {
            result += in.charAt(in.length()-1);
        }
        return result;
    }
    
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
		// 整数の入力
		String a = sc.next();
		System.out.println(conv(a));
	}
}


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

import java.util.*;

public class Main {

    public static int sum(int n){
        return (1+n)*n/2;
    }

    public static String conv(String in){
        String result = "";
        int i = 1;
        for (; i < in.length(); i++) {
            if (in.charAt(i) != 'B') {
                result += in.charAt(i-1);
            }
        }
        if (in.charAt(i) != 'B') {
            result += in.charAt(i);
        }
    }
    
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
		// 整数の入力
		String a = sc.next();
		System.out.println(conv(a));
	}
}


Compiler output:
Main.java:20: error: missing return statement
    }
    ^
1 error
Language: Java

import java.util.*;

public class Main {

    public static int sum(int n){
        return (1+n)*n/2;
    }

    public static String conv(String in){
        String result = "";
        int i = 1;
        for (; i < in.length(); i++) {
            if (in.charAt(i) != 'B') {
                result += in.charAt(i-1);
            }
        }
        if (in.charAt(i) != 'B') {
            result += in.charAt(i);
        }
    }

	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.next();
		System.out.println(conv(a));
	}
}


Compiler output:
Main.java:25: error: incompatible types: String cannot be converted to int
		int a = sc.next();
		               ^
Main.java:26: error: incompatible types: int cannot be converted to String
		System.out.println(conv(a));
		                        ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

import java.util.*;

public class Main {

    public static int sum(int n){
        return (1+n)*n/2;
    }

    public static String conv(String in){
        String result = "";
        int i = 1;
        for (; i < in.length; i++) {
            if (in.charAt(i) != 'B') {
                result += in.charAt(i-1);
            }
        }
        if (in.charAt(i) != 'B') {
            result += in.charAt(i);
        }
    }

	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextString();
		System.out.println(conv(a));
	}
}


Compiler output:
Main.java:12: error: cannot find symbol
        for (; i < in.length; i++) {
                     ^
  symbol:   variable length
  location: variable in of type String
Main.java:25: error: cannot find symbol
		int a = sc.nextString();
		          ^
  symbol:   method nextString()
  location: variable sc of type Scanner
Main.java:26: error: incompatible types: int cannot be converted to String
		System.out.println(conv(a));
		                        ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
Language: C++

#include<iostream>
using namespace std;

int main(int argc, char const *argv[]) {
  string s,sout;
  int i;
  cin>>s;

  for(i=0;i<s.length;i++){
    if(s[i]=="B"){
      if (!(sout.empty())) {
        sout.pop_back();
      }
    }
    else{
      sout+=s[i];
    }
  }

  cout<<sout;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:9:15: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |   for(i=0;i<s.length;i++){
      |             ~~^~~~~~
      |                     ()
a.cc:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(s[i]=="B"){
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
	string s;
	string ans="";
	cin >> s;
	for (int i = 0; i < s.size(); ++i)
	{
		switch(s[i]){
			case '0':
			ans+="0";
			break;
			case '1':
			ans+="1";
			break;
			case 's':
			if(!ans.empty()) 10ans.erase(ans.size()-1);
			break;
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:42: error: unable to find numeric literal operator 'operator""ans.erase'
   18 |                         if(!ans.empty()) 10ans.erase(ans.size()-1);
      |                                          ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++)
#define numa(x,a) for(auto x: a)
#define ite iterator
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define pf push_front
#define sec second
#define sz(x) ((int)(x).size())
#define ALL( c ) (c).begin(), (c).end()
#define gcd(a,b) __gcd(a,b)
#define mem(x,n) memset(x,n,sizeof(x))
#define endl "\n"
using namespace std;
template <int POS, class TUPLE> void deploy(std::ostream &os, const TUPLE &tuple){}
template <int POS, class TUPLE, class H, class ...Ts> void deploy(std::ostream &os, const TUPLE &t){ os << (POS == 0 ? "" : ", ") << get<POS>(t); deploy<POS + 1, TUPLE, Ts...>(os, t); }
template <class T,class U> std::ostream& operator<<(std::ostream &os, std::pair<T,U> &p){ os << "(" << p.first <<", " << p.second <<")";return os; }
template <class T> std::ostream& operator<<(std::ostream &os, std::vector<T> &v){ int remain = v.size(); os << "{"; for(auto e: v) os << e << (--remain == 0 ? "}" : ", "); return os; }
template <class T> std::ostream& operator<<(std::ostream &os, std::set<T> &v){ int remain = v.size(); os << "{"; for(auto e: v) os << e << (--remain == 0 ? "}" : ", "); return os; }
template <class T, class K> std::ostream& operator<<(std::ostream &os, std::map<T, K> &mp){ int remain = mp.size(); os << "{"; for(auto e: mp) os << "(" << e.first << " -> " << e.second << ")" << (--remain == 0 ? "}" : ", "); return os; }
#define DEBUG1(var0) { std::cerr << (#var0) << "=" << (var0) << endl; }
#define DEBUG2(var0, var1) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG1(var1); }
#define DEBUG3(var0, var1, var2) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG2(var1,var2); }
#define DEBUG4(var0, var1, var2, var3) { std::cerr << (#var0) << "=" << (var0) << ", ";DEBUG3(var1,var2,var3); }
using ll = long long;


int main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  string S;
  stack <char> ans;
  cin >> S;
  numa(c, S){
    if (c == 'B') {
      if (!ans.empty()) {
        ans.pop();
      }
    }else{
      ans.push(c);
    }
  }
  string output;
  while(!ans.empty()){
    output += ans.top();
    ans.pop();
  }
  reverse(ALL(output));
  cout << ouput << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:56:11: error: 'ouput' was not declared in this scope; did you mean 'output'?
   56 |   cout << ouput << endl;
      |           ^~~~~
      |           output
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
	string s;
	cin>>s;
	int sLen=s.length()+1;
	char *s1 = new char[sLen];
	memset(s1,'\0',sLen);
	char *pStr = (char*)s.c_str();
	int i=0;
	while (*pStr != '\0'){
		if (*pStr != 'B'){
			s1[i++] += *pStr;
		}else{
			if (i>0){
				i--;
				s1[i]='\0';
			}
		}
		pStr++;
	}
	cout<<s1<<endl;
	delete[] s1;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:10:9: error: 'memset' was not declared in this scope
   10 |         memset(s1,'\0',sLen);
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <iostream>
#include <string>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

int main(void){
	string s; cin >> s;
	string ans;
	rep(i, s.size()){
		if(s[i] == '0') ans += '0';
		else if(s[i] == '1') ans += '1';
		else{
			if(!s) ans.pop_back();//空文字でなければ
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:28: error: no match for 'operator!' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   13 |                         if(!s) ans.pop_back();//空文字でなければ
      |                            ^~
a.cc:13:28: note: candidate: 'operator!(bool)' (built-in)
a.cc:13:28: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
Language: C

#include <stdio.h>
#include <String.h>

int main(){
	char s[10];
	int i;
	for(i = 0; i < 10; i++){
		s[i] = getchar();
		if(s[i] == '\n' || s[i] == '\r') break;
	}
	s[i] ='\0';
	
	int s_index = 0;
	int s_len = strlen(s);
	int consec_b_count = 0;
	
	if(s[0] == 'B'){ // if first letter is B, don't need to delete anything beforehand
		while(s[s_index] == 'B'){
			s_index++;
		}
	}
	
	while(s_index < s_len){
		s_index++;
		if(s[s_index] == 'B' ){
			consec_b_count++;
		}
		else if( consec_b_count != 0){ // if we run into a 0 or a 1 after a B
			int index_to_change = s_index - consec_b_count;
			
			for(; consec_b_count > 0; consec_b_count--){
				
				if(index_to_change < 0){
					consec_b_count = 0;
					break;
				}
				while( s[index_to_change] !='0' && s[index_to_change] !='1' ){
					index_to_change--;
					if(index_to_change < 0){
						break;
					}
				}
				
				if(index_to_change < 0){
					consec_b_count = 0;
					break;
				}
				s[index_to_change] = 'X';
				index_to_change--;
				
			}
		}
		
	}
	
	i = 0;
	while(i < s_len){
		if(s[i] == '0' || s[i] == '1') printf("%c", s[i]);
		
		i++;
	}
	return 0;
}

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

#include<stdio.h>
#include <stdlib.h>




int main() {
	char s[11];
	char r[11];
	char buf[64];
	int i,n,j,dummy,k;
	scanf_s("%s", s, 11);
	for (n = 0; s[n] != '\0'; n++);

	for (i = 0, j=0; s[i] != '\0'; i++) {
		fgets(buf, 64, stdin);
		if (s[i] == 'B') {
			j--;
		}
		else {
			r[j] = s[i];
			j++;
		}
		for (k = 0, r[j] = '\0'; k < j; k++) printf("%c", r[k]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   12 |         scanf_s("%s", s, 11);
      |         ^~~~~~~
      |         scanf