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

#include <iostream>

using namespace std;
int main(int argc, char const *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  string ans;
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] == 'B') {
      ans.pop_back();
    } else {
      if (ans.length > 0) {
        ans.push_back(s[i]);
      }
    }
  }


  cout << ans << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:14: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 '()' ?)
   14 |       if (ans.length > 0) {
      |           ~~~~^~~~~~
      |                     ()
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	string s;
	cin >> s;
	string ans;
	for (char c : s) {
		if (c == 1) {
			ans+='1'
		}
		else if (c == 0) {
			ans+='0'
		}
		else {
			if (s.begin() == s.end()) {
				continue;
			}
			else {
				ans.erase(ans.end() - 1);
			}
		}
	}

	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:33: error: expected ';' before '}' token
    9 |                         ans+='1'
      |                                 ^
      |                                 ;
   10 |                 }
      |                 ~                
a.cc:12:33: error: expected ';' before '}' token
   12 |                         ans+='0'
      |                                 ^
      |                                 ;
   13 |                 }
      |                 ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	string s;
	cin >> s;
	string ans;
	for (char c : s) {
		if (c == 1) {
			ans+='1'
		}
		else if (c == 0) {
			ans+='0'
		}
		else {
			if (s.begin() == s.end()) {
				continue;
			}
			else {
				s.erase(s.end() - 1);
			}
		}
	}

	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:33: error: expected ';' before '}' token
    9 |                         ans+='1'
      |                                 ^
      |                                 ;
   10 |                 }
      |                 ~                
a.cc:12:33: error: expected ';' before '}' token
   12 |                         ans+='0'
      |                                 ^
      |                                 ;
   13 |                 }
      |                 ~
Language: C++

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

int main(){
	string s;
	cin >>s;
	int n=-1;
	string t="           ";
	for(int i =0; i< s.size(); i++) {
		if(s[i] == "B" && n>=0) {
			t[n--] = "";
		} else {
			t[++n] = s[i];
		}
	}
	cout << t << endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |                 if(s[i] == "B" && n>=0) {
a.cc:11:34: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   11 |                         t[n--] = "";
      |                                  ^~
      |                                  |
      |                                  const char*
Language: C++

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

int main()
{
    char s[100],s1[100];
    cin>>s;
    for(int i=0; i<strlen(s); i++){
        s1[i]='2';
        if(s1[i]=='B'&&i==0){
            continue;
        }
        else{
        if(s[i]=='0'){
            s1[i]='0';
        }
        else if(s[i]=='1'){
            s1[i]='1';
        }
        else{
            s1[i-1]='2';
        }
    }
    for(int i=0; i<strlen(s); i++){
        if(s1[i]!='2'){
            cout<<s1[i];
        }
    }
    return 0;
}


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

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

int main()
{
    char s[100],s1[100];
    cin>>s;
    for(int i=0; i<strlen(s); i++){
        s1[i]='2';
        if(s1[i]=='B'){
            continue;
        }
        else{
        if(s[i]=='0'){
            s1[i]='0';
        }
        else if(s[i]=='1'){
            s1[i]='1';
        }
        else{
            s1[i-1]='2';
        }
    }
    for(int i=0; i<strlen(s); i++){
        if(s1[i]!='2'){
            cout<<s1[i];
        }
    }
    return 0;
}


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

#include <cstdio>
#include <stack>
#include <cstring>

using namespace std;

stack<int> s;

int main()
{
    int n, lim;
    char str[15];

    gets(str+1);
    n = strlen(str);

    for(int i=1; i<n; i++)
    {
        if(str[i] == '0' || str[i] == '1')
            s.push(str[i]);
        else
            s.pop();
    }

    lim = s.size();
    for(int i=1; i<=lim; i++)
    {
        str[i] = s.top();
        s.pop();
    }

    for(int i=1; i<=lim; i++)
        printf("%c", str[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(str+1);
      |     ^~~~
      |     getw
Language: C++

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

int main() {
	string s, a='';
	cin >> s;

	for(int i=0;i<s.size();i++) {
		if(s.at(i) == '0') a += '0';
		if(s.at(i) == '1') a += '1';
		if(s.at(i) == 'B') a.pop_back();
	}

	cout << a << endl;
}


Compiler output:
a.cc:5:21: error: empty character constant
    5 |         string s, a='';
      |                     ^~
a.cc: In function 'int main()':
a.cc:5:21: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
Language: Java

import java.util.*;
public class Keyboard {

	public static void main(String[] args) {
		// TODO 自动生成的方法存根
		Scanner sc=new Scanner(System.in);
		String b=sc.nextLine();
		String K ;
		int j=0;
		StringBuilder builder=new StringBuilder("");
		for(int i=0;i<b.length();i++) {
			K=b.substring(i,i+1);
			if(K.equals("B")&&builder.length()>0) {//如果是B空格键就删除前面的元素,如果不是添加进集合中
				builder.delete(j-1,j);
				j--;
			}if(K.equals("1")) {
				builder.append(K);
				j++;
			}if(K.equals("0")){
				builder.append(K);
				j++;
			}
		}
		System.out.println(builder.toString());
		}
}

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

import java.util.*;
public class Keyboard {

	public static void main(String[] args) {
		// TODO 自动生成的方法存根
		Scanner sc=new Scanner(System.in);
		String b=sc.nextLine();
		String K ;
		int j=0;
		StringBuilder builder=new StringBuilder("");
		for(int i=0;i<b.length();i++) {
			K=b.substring(i,i+1);
			if(K.equals("B")&&builder.length()>0) {//如果是B空格键就删除前面的元素,如果不是添加进集合中
				builder.delete(j-1,j);
				j--;
			}if(K.equals("1")) {
				builder.append(K);
				j++;
			}if(K.equals("0")){
				builder.append(K);
				j++;
			}
		}
		System.out.println(builder.toString());
	}
}

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

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
char s[105],ans[105];
int main()
{
	gets(s);
	int len=strlen(s),tot=0;
	for(int i=0;i<len;i++)
	{
		if(s[i]=='0')	ans[++tot]='0';
		if(s[i]=='B'&&tot>0)	tot--;
		if(s[i]=='1')	ans[++tot]='1';
	}
	for(int i=1;i<=tot;i++)
	{
		cout<<ans[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<iostream>
#include<cstring>
using namespace std;
char s[105],ans[105];
int main()
{
	gets(s);
	int len=strlen(s),tot=0;
	for(int i=0;i<len;i++)
	{
		if(s[i]=='0')	ans[++tot]='0';
		if(s[i]=='B'&&tot>0)	tot--;
		if(s[i]=='1')	ans[++tot]='1';
	}
	for(int i=1;i<=tot;i++)
	{
		cout<<ans[i];
	}
	return 0;
}

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

#include<cstdio>
#include<cmath>
#include<iostream>
typedef long long ll;
using namespace std;

char a[100000];
int main()
{
	int n,i;
	scanf("%s",a);
	n = strlen(a);
	for(i = 0; i < n ; i++)
	{
		if(a[i] == '0')
		printf("0");
		else if(a[i] == '1')
		printf("1");
		else 
		printf("\b");
	}
	printf("\n");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: 'strlen' was not declared in this scope
   12 |         n = strlen(a);
      |             ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<iostream>
  +++ |+#include <cstring>
    4 | typedef long long ll;
Language: C

*s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      | ^
main.c:1:2: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
    1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |  ^
main.c:1:4: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
    1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |    ^
main.c:1:13: error: initialization of 'char *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
    1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |             ^
main.c:1:13: error: initializer element is not constant
main.c:1:20: error: initialization of 'char *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
    1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |                    ^
main.c:1:20: error: initializer element is not constant
main.c:1:24: error: return type defaults to 'int' [-Wimplicit-int]
    1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |                        ^~~~
main.c: In function 'main':
main.c:1:35: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |                                   ^~~~
main.c:1:46: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
    1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |                                              ^
main.c:1:75: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |                                                                           ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
Language: C

s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:13: error: initialization of 'char *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
    1 | s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |             ^
main.c:1:20: error: initialization of 'char *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
    1 | s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |                    ^
main.c:1:24: warning: data definition has no type or storage class
    1 | s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |                        ^
main.c:1:24: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:1:26: error: return type defaults to 'int' [-Wimplicit-int]
    1 | s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |                          ^~~~
main.c: In function 'main':
main.c:1:37: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    1 | s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |                                     ^~~~
main.c:1:48: error: invalid operands to binary - (have 'char *' and 'int *')
    1 | s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |                                             ~~~^
      |                                              | |
      |                                              | int *
      |                                              char *
main.c:1:77: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
      |                                                                             ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	string t;
	 t="";
	for(int i=0;i<s.size();i++)P{
		if(s[i]=='1') t+='1';
		else if(s[i]=='0') t+='0';
		else if(t.size()>0) t.erase(t.end()-1);
	} 
	cout<<t;
	return 0; 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:36: error: 'P' was not declared in this scope
    8 |         for(int i=0;i<s.size();i++)P{
      |                                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	string
	 t="";
	for(int i=0;i<s.size();i++)P{
		if(s[i]=='1') t+='1';
		else if(s[i]=='0') t+='0';
		else if(t.size()>0) t.erase(t.end()-1);
	} 
	cout<<t; 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:36: error: 'P' was not declared in this scope
    8 |         for(int i=0;i<s.size();i++)P{
      |                                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	strint t="";
	for(int i=0;i<s.size();i++)P{
		if(s[i]=='1') t+='1';
		else if(s[i]=='0') t+='0';
		else if(t.size()>0) t.erase(t.end()-1);
	} 
	cout<<t; 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'strint' was not declared in this scope; did you mean 'strcat'?
    6 |         strint t="";
      |         ^~~~~~
      |         strcat
a.cc:7:36: error: 'P' was not declared in this scope
    7 |         for(int i=0;i<s.size();i++)P{
      |                                    ^
a.cc:12:15: error: 't' was not declared in this scope
   12 |         cout<<t;
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int i,pos,a;
	string s;
	cin>>s;
	for(i=1;i<=s.size();i++)
	{
		if(s[1]=='B')
		{
			a.erase('B',2)
		}
		if(s[1]==0)
		{
			a+=0;
		}
		else
		{
			a+=1;
		}
	}
	cout<<a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: error: request for member 'erase' in 'a', which is of non-class type 'int'
   12 |                         a.erase('B',2)
      |                           ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int i,s,pos,a;
	cin>>s;
	for(i=1;i<=s.size();i++)
	{
		if(s[1]=='B')
		{
			a.erase('B',2)
		}
		if(s[1]==0)
		{
			a+=0;
		}
		else
		{
			a+=1;
		}
	}
	cout<<a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: request for member 'size' in 's', which is of non-class type 'int'
    7 |         for(i=1;i<=s.size();i++)
      |                      ^~~~
a.cc:9:21: error: invalid types 'int[int]' for array subscript
    9 |                 if(s[1]=='B')
      |                     ^
a.cc:11:27: error: request for member 'erase' in 'a', which is of non-class type 'int'
   11 |                         a.erase('B',2)
      |                           ^~~~~
a.cc:13:21: error: invalid types 'int[int]' for array subscript
   13 |                 if(s[1]==0)
      |                     ^
Language: C++

#include <iostream>
#include <string>

int main() {
  std::string s;
  std::cin >> s;

  std::string str = "";
  for (int i = 0; i < n; ++i) {
    if ( s[i] == 'B' && str.length() > 0 ) {
      str.erase(str.length() - 1);
    } else if ( s[i] != 'B' ) {
      str += s[i];
    }
  }
  std::cout << str << std::endl;

  return 0;
}


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


/*  
    |\_/|
    |* *|
    \_+_/
*/
#include<bits/stdc++.h>

#define endl '\n'

using namespace std;

int main(){

  cin.tie(0);     // cout と cin の同期を切る
  ios::sync_with_stdio(false);  /* cの stdioストリーム (printfとか)と*/


  stack <int > st;

  queue<int>st2;
  
  string str;

  cin>>str;

  for(int i=0;i<str.length();i++){

    if(str[i]=='B'){
      if(st.size()){
	st.pop();
      }
    }
    else{
      if(str[i]=='1'){
	st.push(1);
      }else{
	st.push(0);
      }
    }

  }

  while(st.size()){

    st2.push(st.top());

    st.pop();

  }

  while(st2.size()){

    cout<<st2.top();

    st2.pop();

  }
  
  cout<<endl;
  
  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:15: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   54 |     cout<<st2.top();
      |               ^~~
      |               pop
Language: C++

#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <string.h>
#include <cstdio>
using namespace std;
void deleteAllMark(string &s, const string &mark)
{
    size_t nSize = mark.size();
    while(1)
    {
        size_t pos = s.find(mark);
        if(pos == string::npos)
        {
            return;
        }
        s.erase(pos, nSize);
    }
}
int main(void)
{
    string input;
    cin >> input;
    //cout << input[input.length()-1] << endl;
    string screen="";
    for(int i=0;i<input.length();i++)
    {
        if(input[i]=='B')
        {
            deleteAllMark(screen," ");
            screen[screen.length()-1]=' ';
            deleteAllMark(screen," ");
            //cout << screen << endl;
        }
        else
        {
            screen+=input[i];
            //cout << screen << endl;
        }
    }
    cout << screen << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:42:28: error: expected '}' at end of input
   42 |     cout << screen << endl;
      |                            ^
a.cc:22:1: note: to match this '{'
   22 | {
      | ^
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  char s[11];
  int flag[10]={};
  scanf("%s",s);
  for(int i=0;i<strlen(s);i++){
    if(s[i]!='B')
      flad[i]=1;
    else{
      for(int j=i-1;j>=0;j--){
        if(flag[j]==1){
          flag[j]=0;
          break;
        }
      }
    }
  }
  for(int i=0;i<strlen(s);i++)
    if(flag[i])
      printf("%c",s[i]);
  printf("\n");
}

Compiler output:
main.c: In function 'main':
main.c:9:7: error: 'flad' undeclared (first use in this function); did you mean 'flag'?
    9 |       flad[i]=1;
      |       ^~~~
      |       flag
main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  char s[11];
  flag[10]={};
  scanf("%s",s);
  for(int i=0;i<strlen(s);i++){
    if(s[i]!='B')
      flad[i]=1;
    else{
      for(int j=i-1;j>=0;j--){
        if(flag[j]==1){
          flag[j]=0;
          break;
        }
      }
    }
  }
  for(int i=0;i<strlen(s);i++)
    if(flag[i])
      printf("%c",s[i]);
  printf("\n");
}

Compiler output:
main.c: In function 'main':
main.c:5:3: error: 'flag' undeclared (first use in this function)
    5 |   flag[10]={};
      |   ^~~~
main.c:5:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:12: error: expected expression before '{' token
    5 |   flag[10]={};
      |            ^
main.c:9:7: error: 'flad' undeclared (first use in this function)
    9 |       flad[i]=1;
      |       ^~~~
Language: C++

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

int main(){
  string s="",command;
  cin>>command;
  for(int i=0;i<command.size();i++){
    switch(command[i]){
      case '0':
        s+='0';
        break;
      case '1':
        s+='1';
        break;
      case 'B':
        if(s.size()!=0){
          s-=s[s.size()-1];
        }
        break;
    }
  }
  cout<<s<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
   17 |           s-=s[s.size()-1];
Language: C

#include <stdio.h>
#include <string.h>
int main(void){
 char s[11],c[11];
 int i,j=0;
 scanf("%s",s);
 for(i=0;i<strlen(s);i++){
  if(s[i]!='B') c[j++]=s[i];
  else{
   if(j>0) c[--j]='\0';
   else c[j]='\0';
 }
 c[j]='\0';
 printf("%s",c);
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:1: error: expected declaration or statement at end of input
   16 | }
      | ^
Language: C

#include <stdio.h>
#include <string.h>
int main(void){
 char s[11],c[11];
 int i,j=0;
 scanf("%s",s);
 for(i=0;i<strlen(s);i++){
  if(s[i]!='B') c[j++]=s[i];
  else j>0?c[--j]='\0':c[j]='\0';
 }
 c[j]='\0';
 printf("%s",c);
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:28: error: lvalue required as left operand of assignment
    9 |   else j>0?c[--j]='\0':c[j]='\0';
      |                            ^
Language: C++

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

int main(){
  string s;
  char c;
  while(cin>>c){
    if(c-'B'){
      s+=c;
    }else if(s!=""){
      s.pop_back;
    }
    cout<<s<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
   11 |       s.pop_back;
      |       ~~^~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here
 2174 |       pop_back() noexcept
      |       ^~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(ll i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 30

signed main()
{
    string S;
    cin >> S;
    vetor<int> ans;
    REP(i, S.length()) {
        if(S[i] == '1') { ans.push_back(1); }
        else if(S[i] == '0') { ans.push_back(0); }
        else if(ans.size() > 0) { ans.pop_back(); }
    }
    REP(i, ans.size()) {
        printf("%lld", ans[i]);
    }
    printf("\n");

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: 'vetor' was not declared in this scope
   27 |     vetor<int> ans;
      |     ^~~~~
a.cc:27:14: error: expected primary-expression before '>' token
   27 |     vetor<int> ans;
      |              ^
a.cc:27:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |     vetor<int> ans;
      |                ^~~
      |                abs
Language: C++

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())

// {{{
template<typename T>
void printmatrix(vector<vector<T> > ar){
    for (int i = 0; i < (int)ar.size(); i++) {
        for (int j = 0; j < (int)ar[0].size(); j++) {
            cout << ar[i][j];
        }
        cout << endl;
    }
}

template<typename T>
void printvector(vector<T> vec){
    for (int i = 0; i < (int)vec.size(); i++) {
        cout << vec[i] << endl;
    }
}

template<typename T>
void unique(vector<T>& vec){
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
}

template<typename T>
vector<T> cumsum(vector<T> vec){
    vector<T> newvec((T)vec.size());
    int tmp = 0;
    for (int i = 0; i < (int)vec.size(); i++) {
        tmp += vec[i];
        newvec[i] = tmp;
    }

    return newvec;
}

template<typename T>
T digitsum(T x){
    T y=0;
    while(x){
        y += x % 10;
        x /= 10;
    }

    return y;
}

template<typename T>
T gcd(T x, T y){
    if (x == 0 || y == 0) {
        return 0;
    }

    while (x != y){
        if (x > y) {
            x -= y;
        }else{
            y -= x;
        }
    }
    return x;
}

// }}}
/* vim:set foldmethod=marker: */

void solve(){
    string s;
    cin >> s;

    string ans="";
    for (int i = s.length()-1; i >= 0; i--) {
        // cout << i << endl;
        if (s[i] != 'B') {
            // cout << i << endl;
            ans = s[i] + ans;
        }else{
            if (i >= 1 && s[i] == 'B') {
                i-=2;
            }else{
                i--;
            }
        }
    }

    cout << ans << endl;
    return;
}

int main(int argc, char const* argv[])
{
    solve();
    return 0;
}

// sortの仕方
// int a[N];
// array<int,N> ar;
// vector<int> v;
//
// sort(a, a+N); // 配列
// sort(ar.begin(), ar.end()); // array
// sort(v.begin(), v.end()); // vector 昇順
// sort(v.begin(), v.end(), greater<int>()); // 降順

// Template
// template <class T>
// T foomax(T x, T y){
//   if (x > y){
//     return x;
//   }else{
//     return y;
//   }
// }

// string を int に変換 stoi("1010")
// int を string に変換 to_string(1010)


// map の key, value を全て抜き出す。
// for (auto itr = mp.begin(); itr != mp.end(); itr++) {
//     cout << "key" << itr->first << " value" << itr->second << endl;
/

Compiler output:
a.cc:132:1: error: expected unqualified-id before '/' token
  132 | /
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  int s=S.size();
  for(int i=0;i<s;i++){
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected '}' at end of input
    8 |   for(int i=0;i<s;i++){
      |                       ~^
a.cc:8:24: error: expected '}' at end of input
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: Java

import java.util.*;


public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！
ArrayList<String> in=new ArrayList<String>();
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
String s[]=line.split("",0);
for(int i=0;i<s.length;i++){
if(s[i].equals("1"))
in.add("1");

if(s[i].equals("0"))
in.add("0");
if(s[i].equals("B")&&in.size()!=0)
in.remove(in.size()-1);

}
for(int i=0;i<in.size();i++)
        System.out.print(in.get(i));
    }
System.out.println();
}

Compiler output:
Main.java:25: error: <identifier> expected
System.out.println();
                  ^
1 error
Language: C++

S = input()

#print(S)
ans = []

for str in S:
    if str == '0':
        ans.append('0')
    elif str == '1':
        ans.append('1')
    else:
        if len(ans) > 0:
            ans.pop()
            

for a in ans:
    print(a,end ="")


print()


Compiler output:
a.cc:3:2: error: invalid preprocessing directive #print
    3 | #print(S)
      |  ^~~~~
a.cc:1:1: error: 'S' does not name a type
    1 | S = input()
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	string ans,s;
	cin >> s;

	for (int i = 0; i < s.size(); i++){
		if(s[i] == '0')
			ans += '0';
		else if(s[i] == '1')
			ans += '1';
		else if(s[i] == 'B' && s[i] != "")
			ans.pop_back();
	}
	cout << ans << endl;
}

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

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

int main() {
	string　s;
	cin >> s;
	vector<char> v;
	int n = s.size();
	for (int i = 0;i < n;i++) {
		if (s[i] == '0')v.push_back('0');
		else if (s[i] == '1')v.push_back('1');
		else v.pop_back();
	}
	int m = v.size();
	for (int i = 0;i < m;i++)cout << v[i];
}


Compiler output:
a.cc:7:9: error: extended character 　 is not valid in an identifier
    7 |         string　s;
      |         ^
a.cc: In function 'int main()':
a.cc:7:9: error: 'string\U00003000s' was not declared in this scope
    7 |         string　s;
      |         ^~~~~~~~~
a.cc:8:16: error: 's' was not declared in this scope
    8 |         cin >> s;
      |                ^
Language: C++

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

int main() {
	string
	cin >> s;
	vector<char> v;
	int n = s.size();
	for (int i = 0;i < n;i++) {
		if (s[i] == '0')v.push_back('0');
		else if (s[i] == '1')v.push_back('1');
		else v.pop_back();
	}
	int m = v.size();
	for (int i = 0;i < m;i++)cout << v[i];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: expected initializer before '>>' token
    8 |         cin >> s;
      |             ^~
a.cc:10:17: error: 's' was not declared in this scope
   10 |         int n = s.size();
      |                 ^
Language: C++

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

int main() {
	string
	cin >> s;
	vector<char> v;
	int n = s.size();
	for (int i = 0;i < n;i++) {
		if (s[i] == '0')v.push_back('0');
		else if (s[i] == '1')v.push_back('1');
		else v.pop_back();
	}
	int m = v.size();
	for (int i = 0;i < m;i++)cout << v[i];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: expected initializer before '>>' token
    8 |         cin >> s;
      |             ^~
a.cc:10:17: error: 's' was not declared in this scope
   10 |         int n = s.size();
      |                 ^
Language: C++

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

int main() {
	string s;
	cin >> s;
	vector<char> v;
	int n = s.size();
	for (int i = 0;i < n;i++) {
		if (s[i] == '0')v.push_back('0');
		else if (s[i] == '1')v.push_back('1');
		else v.pop_back;
	}
	int m = v.size();
	for (int i = 0;i < m;i++)cout << v[i];
}

	

Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = char; _Alloc = std::allocator<char>]'
   14 |                 else v.pop_back;
      |                      ~~^~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1324:7: note: declared here
 1324 |       pop_back() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

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

int main() {
	string s;
	cin >> s;
	vector<char> v;
	int n = s.size();
	for (int i = 0;i < n;i++) {
		if (s[i] == '0')v.push_back('0');
		else if (s[i] == '1')v.push_back('1');
		else v.pop_back;
	}
	int m = v.size();
	for (int i = ;i < m;i++)cout << v[i];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = char; _Alloc = std::allocator<char>]'
   14 |                 else v.pop_back;
      |                      ~~^~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1324:7: note: declared here
 1324 |       pop_back() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
a.cc:17:22: error: expected primary-expression before ';' token
   17 |         for (int i = ;i < m;i++)cout << v[i];
      |                      ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  string s;
  cin >> s;
  string ans = "";
  for(char c : s){
    if(c == '1' || c == '0'){
      ans += c;
    }else{
      if(s.size()) ans = ans.substr(ans.size() - 1);
    }
  }
  cout << ans < <endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected primary-expression before '<' token
   15 |   cout << ans < <endl;
      |                 ^
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
	int i,p;
	char sd[10] = "";
	char f[20] = "";
	char e[20];
	scanf("%s",sd);
	p = strlen(sd);
	for (i = 0;i < p; i++) {
		if (sd[i] == '0') {
			strcat_s(f, "0");
		}
		if (sd[i] == '1') {
			strcat_s(f, "1");
		}
		if (sd[i] == '2') {
		    strncpy_s(e, f, (int)(strlen(f) - 1));
			strcpy_s(f, e);

		}
	}
	printf("%s\n", f);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:25: error: implicit declaration of function 'strcat_s'; did you mean 'strcat'? [-Wimplicit-function-declaration]
   12 |                         strcat_s(f, "0");
      |                         ^~~~~~~~
      |                         strcat
main.c:18:21: error: implicit declaration of function 'strncpy_s'; did you mean 'strncpy'? [-Wimplicit-function-declaration]
   18 |                     strncpy_s(e, f, (int)(strlen(f) - 1));
      |                     ^~~~~~~~~
      |                     strncpy
main.c:19:25: error: implicit declaration of function 'strcpy_s'; did you mean 'strcpy'? [-Wimplicit-function-declaration]
   19 |                         strcpy_s(f, e);
      |                         ^~~~~~~~
      |                         strcpy
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main(void)
{
	int i;
	char S[11];

	scanf("%s",S);

	for (i = 0; S[i] != '\0'; i++)
	{
		if (S[i] == 'B')
		{
			printf("\b");

			if (S[i + 1] == '\0')
				printf(" ");

			continue;
		}

		printf("%c",S[i]);
	}

	return 0;


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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define all(a) a.begin(),a.end()

int main(void){
    string s;
    cin>>s;
    reverse(all(s));
    int n = s.size();
    int del = 0;
    rep(i,n){
        if(s[i]=='B'){
            del++;
        }else if(del>0){
            s[i] = 'B';
            de--;
        }
    }
    reverse(all(s));
    rep(i,n){
        if(s[i]!='B')cout<<s[i];
    }
    cout<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'de' was not declared in this scope; did you mean 'del'?
   17 |             de--;
      |             ^~
      |             del
Language: C++

#include<stdio.h>
#include <string.h>
 
int main(){
  char input[10], output[10];
  
  scanf("%s", input);
  
  int index = 0;
  
  for(int i = 0; i <= strlen(input); i++){
    if(strcmp(input[i], "0") == 0){
      output[index] = "0";
    }else if(strcmp(input[i], "1") == 0){
      output[index] = "1";
    }else if(strcmp(input[i], "B") == 0){
      if(index > 0){
        index--;
        output[index] = NULL;
      }
    }
   index++;
  }
  
  printf("%s", output);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   12 |     if(strcmp(input[i], "0") == 0){
      |               ~~~~~~~^
      |                      |
      |                      char
In file included from a.cc:2:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:13:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   13 |       output[index] = "0";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:14:28: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   14 |     }else if(strcmp(input[i], "1") == 0){
      |                     ~~~~~~~^
      |                            |
      |                            char
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:15:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   15 |       output[index] = "1";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:16:28: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   16 |     }else if(strcmp(input[i], "B") == 0){
      |                     ~~~~~~~^
      |                            |
      |                            char
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:19:25: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
   19 |         output[index] = NULL;
      |                         ^~~~
Language: C++

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

int main(){
  char input[10], output[10];
  
  scanf("%s", input);
  
  int index = 0;
  
  for(int i = 0; i <= strlen(input); i++){
    if(input[i] == "0"){
      output[index] = "0";
    }else if(input[i] == "1"){
      output[index] = "0";
    }else if(input[i] == "B"){
      if(index > 0){
        index--;
        output[index] = NULL;
      }
    }
   index++;
  }
  
  printf("%s", output);
  return 0;
}
   

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     if(input[i] == "0"){
      |        ~~~~~~~~~^~~~~~
a.cc:13:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   13 |       output[index] = "0";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:14:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     }else if(input[i] == "1"){
      |              ~~~~~~~~~^~~~~~
a.cc:15:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   15 |       output[index] = "0";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:16:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |     }else if(input[i] == "B"){
      |              ~~~~~~~~~^~~~~~
a.cc:19:25: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
   19 |         output[index] = NULL;
      |                         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
char a[1005];
char b[1005];
int p;
int main(){
	gets(a);
	for(int i=0;i<strlen(a);i++){
		if(a[i]=='B'){
			if(p>=1) p--;
		} 
		else b[++p]=a[i]; 
	}
	for(int i=1;i<=p;i++) cout<<b[i];
	cout<<endl;
	return 0;
}

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

#include<iostream>
#include<string>
using namespace std;
int main(){
  string s="";
  string ans="";
  cin>>s;
  for(int i=0;i<10;i++){
    char temp=s[i];
    if(temp=='0')ans.push_back('0');
    if(temp=='1')ans.push_back('1');
    if(temp=='B'&&!ans.empty())ans.pop_back();
    if(temp=='')break;
  }
  cout<<ans<<endl;
  
}

Compiler output:
a.cc:13:14: error: empty character constant
   13 |     if(temp=='')break;
      |              ^~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  string s="";
  string ans="";
  cin>>s;
  for(int i=0;i<10;i++){
    char temp=s[i];
    if(temp=='0')ans.push_back('0');
    if(temp=='1')ans.push_back('1');
    if(temp=='B'&&!ans.empty())ans.pop_back();
    if(temp==null)break;
  }
  cout<<ans<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'null' was not declared in this scope
   13 |     if(temp==null)break;
      |              ^~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  string s="";
  string ans="";
  cin>>s;
  for(int i=0;i<10;i++){
    if(s[i]=="0")ans.push_back('0');
    if(s[i]=="1")ans.push_back('1');
    if(s[i]=="B"&&!ans.empty())ans.pop_back();
    if(s[i]==null)break;
  }
  cout<<ans<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(s[i]=="0")ans.push_back('0');
a.cc:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(s[i]=="1")ans.push_back('1');
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i]=="B"&&!ans.empty())ans.pop_back();
a.cc:12:14: error: 'null' was not declared in this scope
   12 |     if(s[i]==null)break;
      |              ^~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  string s="";
  string ans="";
  cin>>s;
  for(int i=0;i<10;i++){
    if(s[i]=="0")ans.append("0");
    if(s[i]=="1")ans.append("1");
    if(s[i]=="B"&&!ans.empty())ans.pop_back();
    if(s[i]==eof)break;
  }
  cout<<ans<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(s[i]=="0")ans.append("0");
a.cc:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(s[i]=="1")ans.append("1");
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i]=="B"&&!ans.empty())ans.pop_back();
a.cc:12:14: error: 'eof' was not declared in this scope; did you mean 'feof'?
   12 |     if(s[i]==eof)break;
      |              ^~~
      |              feof
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;

int main(){
	string s;
	cin>>s;
	int l=(int)S.length();
	string T;
	rep(i,l){
		int pat==(int)T.length();
		if(S[i]=='0')T.push_back('0');
		if(S[i]=='1')T.push_back('1');
		if(S[i]=='B'&&pat!=0)T.pop_back();
	}
	int k=(int)T.length();
	rep(i,k)cout<<T[i];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: 'S' was not declared in this scope
   17 |         int l=(int)S.length();
      |                    ^
a.cc:20:24: error: expected initializer before '==' token
   20 |                 int pat==(int)T.length();
      |                        ^~
a.cc:23:31: error: 'pat' was not declared in this scope
   23 |                 if(S[i]=='B'&&pat!=0)T.pop_back();
      |                               ^~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  string command="";
  string ans="";
  int number=0;
  cin>>command;
  for(int i=0;i<command.size();i++){
    if(command[i]=="0")ans.append("0");
    if(command[i]=="1")ans.append("1");
    if(command[i]=="B")ans.pop_back();
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(command[i]=="0")ans.append("0");
a.cc:11:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(command[i]=="1")ans.append("1");
a.cc:12:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     if(command[i]=="B")ans.pop_back();
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  string command="";
  string ans="";
  int number=0;
  cin>>command;
  for(int i=0;i<command.size();i++){
    if(command[i].strcomp("0"))ans.append("0");
    if(command[i].strcomp("1"))ans.append("1");
    if(command[i].strcomp("B"))ans.pop_back();
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: request for member 'strcomp' in 'command.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   10 |     if(command[i].strcomp("0"))ans.append("0");
      |                   ^~~~~~~
a.cc:11:19: error: request for member 'strcomp' in 'command.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   11 |     if(command[i].strcomp("1"))ans.append("1");
      |                   ^~~~~~~
a.cc:12:19: error: request for member 'strcomp' in 'command.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   12 |     if(command[i].strcomp("B"))ans.pop_back();
      |                   ^~~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  string command="";
  string ans="";
  int number=0;
  cin>>command;
  for(int i=0;i<command.size();i++)
    switch(command[i]){
        case("0"):ans.append("0");break;
        case("1"):ans.append("1");break;
        case("B"):ans.pop_back();
    }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: conversion from 'const char*' to 'int' in a converted constant expression
   11 |         case("0"):ans.append("0");break;
      |             ~^~~~
a.cc:11:14: error: could not convert '("0")' from 'const char [2]' to 'int'
   11 |         case("0"):ans.append("0");break;
      |             ~^~~~
      |              |
      |              const char [2]
a.cc:12:14: error: conversion from 'const char*' to 'int' in a converted constant expression
   12 |         case("1"):ans.append("1");break;
      |             ~^~~~
a.cc:12:14: error: could not convert '("1")' from 'const char [2]' to 'int'
   12 |         case("1"):ans.append("1");break;
      |             ~^~~~
      |              |
      |              const char [2]
a.cc:13:14: error: conversion from 'const char*' to 'int' in a converted constant expression
   13 |         case("B"):ans.pop_back();
      |             ~^~~~
a.cc:13:14: error: could not convert '("B")' from 'const char [2]' to 'int'
   13 |         case("B"):ans.pop_back();
      |             ~^~~~
      |              |
      |              const char [2]
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  string command="";
  string ans="";
  int number=0;
  cin>>command;
  for(int i=0;i<command.size();i++)
    switch(s[i]){
        case("0"):ans.append("0");
        case("1"):ans.append("1");
        case("B"):ans.pop_back();
    }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 's' was not declared in this scope
   10 |     switch(s[i]){
      |            ^