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

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

int main() {
  string S;
  cin >> S;
  string X;
  
  for (int i = 0; i < S.size(); i++) {
    if(S[i] == 0) {
      X += "0";
    }
    else if (S[i] == 1) {
      X += "1";
    }
    else if (S[i] == "B") {
      if (X != "") {
        X.erase(X.size() - 1);
      }
    }
  }
  cout << X << endl;
  return 0;
}


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

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

int main() {
  string S;
  cin >> S;
  string X;
  
  for (int i = 0; i < S.size(); i++) {
    if(S[i] == 0) {
      X += "0";
    }
    else if (S[i] == 1) {
      X += "1";
    }
    else if (S[i] == B) {
      if (X != "") {
        X.erase(X.size() - 1);
      }
    }
  }
  cout << X << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: 'B' was not declared in this scope
   16 |     else if (S[i] == B) {
      |                      ^
Language: C++

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

int main() {
  string S;
  cin >> S;
  string X;
  
  for (int i = 0; i < S.size(); i++) {
    if(S[i] == 0) {
      X += 0;
    }
    else if (S[i] == 1) {
      X += 1;
    }
    else if (S[i] == B) {
      if (X != "") {
        X.erase(X.size() - 1);
      }
    }
  }
  cout << X << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: ambiguous overload for 'operator+=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   11 |       X += 0;
      |       ~~^~~~
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:1377:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1377 |       operator+=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:1387:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1387 |       operator+=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:1397:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1397 |       operator+=(_CharT __c)
      |       ^~~~~~~~
a.cc:16:22: error: 'B' was not declared in this scope
   16 |     else if (S[i] == B) {
      |                      ^
Language: C++

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

int main() {
  string S;
  cin S;
  string X;
  
  for (int i = 0; i < S.size(); i++) {
    if(S[i] == 0) {
      X += 0;
    }
    else if (S[i] == 1) {
      X += 1;
    }
    else if (S[i] == B) {
      if (X != "") {
        X.erase(X.size() - 1);
      }
    }
  }
  cout << X << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'S'
    6 |   cin S;
      |      ^~
      |      ;
a.cc:11:9: error: ambiguous overload for 'operator+=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   11 |       X += 0;
      |       ~~^~~~
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:1377:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1377 |       operator+=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:1387:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1387 |       operator+=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:1397:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1397 |       operator+=(_CharT __c)
      |       ^~~~~~~~
a.cc:16:22: error: 'B' was not declared in this scope
   16 |     else if (S[i] == B) {
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string s;
  cin >> s;
  int pos = 0;
  vector<char> o(s.size());
  for(auto& c : S){
    if(c=='B'){
      pos = max(0, pos-1);
    }else{
      o[pos] = c;
      pos++;
    }
  }
  for(int ii=0; ii<pos; ii++){
    cout << o[ii];
  }
  cout << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'S' was not declared in this scope
    9 |   for(auto& c : S){
      |                 ^
Language: C++

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

int main(){
    int i, c;
    string s, result = "";
    cin >> s;
    for(i= n.size()-1; i>=0; i--){
        if(s[i] == 'B'){
            c++;
        }else if(c > 0){
            c--;
        }else{
            result = s[i] + result;
        }
    }
    cout << result;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'n' was not declared in this scope
    8 |     for(i= n.size()-1; i>=0; i--){
      |            ^
Language: C++

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

int main(){
    int i, c;
    string s, result = "";
    cin >> s;
    for(i= n.size()-1, i>=0; i--){
        if(s[i] == 'B'){
            c++;
        }else if(c > 0){
            c--;
        }else{
            result = s[i] + result;
        }
    }
    cout << result;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'n' was not declared in this scope
    8 |     for(i= n.size()-1, i>=0; i--){
      |            ^
a.cc:8:33: error: expected ';' before ')' token
    8 |     for(i= n.size()-1, i>=0; i--){
      |                                 ^
      |                                 ;
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

string S,s;

int main(){
    cin>>s;
    for(int i=s.length()-1;i>=0;i--){
        if(s[i]!='B')S+=s[i];
        else i++;
    }
    for(int i=S.length()-1;i>=0;i--){
        printf(S[i]);
    }
    out("");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   31 |         printf(S[i]);
      |         ~~~~~~^~~~~~
      |               |
      |               __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

string S,s;

int main(){
    cin>>s;
    for(int i=s.length()-1;i>=0;i--){
        if(s[i]!='B')S+=s[i];
        else i++;
    }
    for(int i=S.length()-1;i>=0;i--){
        print(S[i]);
    }
    out("");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'print' was not declared in this scope; did you mean 'rint'?
   31 |         print(S[i]);
      |         ^~~~~
      |         rint
Language: C++

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

int main(){
  string s,ans;
  cin>>s;
  int i=0;
  for(i=0;i<s.size();i++){
    if(s[i]=="0"){
      ans[i]="0"
    }else if(s[i]=="1"){
      ans[i]="1"
    }else if(s[i]=="B"){
      if(ans.size()!=0){
        ans[i-1] = " ";
        i = i-1;
      }
    }
  }

  cout<<ans;

  return 0;
}


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"){
a.cc:10:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   10 |       ans[i]="0"
      |              ^~~
      |              |
      |              const char*
a.cc:10:17: error: expected ';' before '}' token
   10 |       ans[i]="0"
      |                 ^
      |                 ;
   11 |     }else if(s[i]=="1"){
      |     ~            
a.cc:11:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     }else if(s[i]=="1"){
a.cc:12:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   12 |       ans[i]="1"
      |              ^~~
      |              |
      |              const char*
a.cc:12:17: error: expected ';' before '}' token
   12 |       ans[i]="1"
      |                 ^
      |                 ;
   13 |     }else if(s[i]=="B"){
      |     ~            
a.cc:13:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     }else if(s[i]=="B"){
a.cc:15:20: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   15 |         ans[i-1] = " ";
      |                    ^~~
      |                    |
      |                    const char*
Language: C++

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

int main() {
  string s, t(0);
  cin >> s;
  
  int i;
  for(i = 0; i < s.size(); i++){
    if(s.at(i) == '0'){
      t += '0';
    }
    else if(s.at(i) == '1'){
      t += '1';
    }
    else if(s.at(i-1) == '0'){
      t -= '0';
    }
    else if(s.at(i-1) == '1'){
      t -= '1';
    }
  }
  
  cout << t << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
   17 |       t -= '0';
      |       ~~^~~~~~
a.cc:20:9: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
   20 |       t -= '1';
      |       ~~^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long unsigned int ll;
 
int main() {
	
  string s;
  string t;
  int a,b,c,d,i,j,k;
  cin >> s;
  
  for(i=0;i<s.length();i++){
	if(s[i]=='1') t.back()='1';
    if(s[i]=='0') t.back()='0';
    if(s[i]=='0'&&s.length()>=1) erase(t.back());
  }
  
  cout << t <<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:34: error: 'erase' was not declared in this scope
   19 |     if(s[i]=='0'&&s.length()>=1) erase(t.back());
      |                                  ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long unsigned int ll;
 
int main() {
	
  string s;
  string t;
  int a,b,c,d,i,j,k;
  cin >> s;
  
  for(i=0;i<s.length();i++){
	if(s[i]=='1') t.back()=='1';
    if(s[i]=='0') t.back()=='0';
    if(s[i]=='0'&&s.length()>=1) erase(t.back());
  }
  
  cout << t <<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:34: error: 'erase' was not declared in this scope
   19 |     if(s[i]=='0'&&s.length()>=1) erase(t.back());
      |                                  ^~~~~
Language: C++

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

int main() {
	//vars;
	string str;

	//input;
	cin >> str;

	//process;
	for (int i = 0; i < str.size; i++) {
		if (str[0] == 'B') {
			str.erase(str.begin());
			i--;
		}
		if (str[i] == 'B'&&i > 0) {
			str.erase(str.begin() + i - 1, str.begin() + i);
			i -= 2;
		}
	}

	//output;
	cout << str;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:33: 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 '()' ?)
   14 |         for (int i = 0; i < str.size; i++) {
      |                             ~~~~^~~~
      |                                     ()
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:8:3: error: 'n' undeclared (first use in this function)
    8 |   n = strlen(s);
      |   ^
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<math.h>

#define rep(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define rrep(i,a,n) for(int (i)=(a);(i)>=(n);(i)--)

#define INF 10000000

typedef  long long ll;

using namespace std;

double euclid_distance(double a,double b){
    return sqrt(a*a+b*b);
}

int gcd(long long int a,long long int b){
    long long int r;
    if(a < b){
        int tmp;
        tmp = a;
        a = b;
        b = tmp;
    }
    while(r != 0){
        r = a % b;
        a = b;
        b = r;
    }
    return r;
}

void Integer_factorization(long long int b,long long int n){
    long long int a = 2;
    long long int count = 0;
    long long int ans = 1;
    long long int ndash = n;
    if(b == 1) cout << n << endl;
    else{
    while(ndash >= a*a){
        if(n % a  == 0){
            count++;
            n/=a;

        if(count % b == 0){
            ans *= a;
        }
        }else{a++;count = 0;}
    }

    cout<<  ans << endl;
    }
}

void ys(){
    cout << "Yes" << endl;
}

void yb(){
    cout << "YES" << endl;
}

void ns(){
    cout << "No" << endl;
}

void nb(){
    cout << "NO" << endl;
}
//A  40s
//B  20min
//C
//D
 string ans;
void solve(void){
    string s;
    cin >> s;

    string ans;
    ep(i,0,s.size()){
        if(i != 0 && s[i] == 'B'){
            if(ans.size()!=0)
            ans.erase(ans.size()-1);
        }else if(s[i] == '0' || s[i] == '1')ans+=s[i];
    }
    if(ans[ans.size()-1] == 'B')ans.erase(ans.size()-1);
    cout << ans;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:85:8: error: 'i' was not declared in this scope
   85 |     ep(i,0,s.size()){
      |        ^
a.cc:85:5: error: 'ep' was not declared in this scope; did you mean 'exp'?
   85 |     ep(i,0,s.size()){
      |     ^~
      |     exp
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  string s;
  cin >> s;
  deque<char> data;
  for(int i = 0; i < s.size(); i--) {
    if(s.at(i) == 'B' && !data.empty())data.pop_back();
    else if(s.at(i) == '1' || s.at(i) == '2')data.push_back(s.at(i));
  }
  while(!data.empty()) {
    cout << data.front();
    data.pop_front;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: invalid use of non-static member function 'void std::deque<_Tp, _Alloc>::pop_front() [with _Tp = char; _Alloc = std::allocator<char>]'
   13 |     data.pop_front;
      |     ~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/deque:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:139,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_deque.h:1574:7: note: declared here
 1574 |       pop_front() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~~
Language: C

#include<stdio.h>

int main(){
  char S[11];
  scanf("%s",S);
  int i;
  for(i=1;i<=9;i++){
    if(S[i] == 'B'){
      S[i] = ¥0;
      S[i-1] = ¥0;
    };
  };
  printf(S);
}

Compiler output:
main.c: In function 'main':
main.c:9:14: error: stray '\302' in program
    9 |       S[i] = <U+00A5>0;
      |              ^~~~~~~~
main.c:10:16: error: stray '\302' in program
   10 |       S[i-1] = <U+00A5>0;
      |                ^~~~~~~~
Language: C++

#include<cstdio>
#include<string>
char s[101],s2[101];
int s1,a;
int main()
{
    scanf("%s",s);
	s1=strlen(s);
    for(int i=0; i<s1; i++)
    {
       switch(s[i])
        {
            case'0':s2[a]='0';
			a++;
			break;
            case'1':s2[a]='1';
			a++;
			break;
            case'B':if(a!=0)
			a--;
			break;
        }
    }
    for(int i=0; i<a; i++)
	{
	   printf("%c",s2[i]);
	}
    printf("\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'strlen' was not declared in this scope
    8 |         s1=strlen(s);
      |            ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<string>
  +++ |+#include <cstring>
    3 | char s[101],s2[101];
Language: C++

#include<cstdio>
#include<string>
char s[101],s2[101];
int s1,a;
int main()
{
    gets(s);
	s1=strlen(s);
    for(int i=0; i<s1; i++)
    {
       switch(s[i])
        {
            case'0':s2[a]='0';
			a++;
			break;
            case'1':s2[a]='1';
			a++;
			break;
            case'B':if(a!=0)
			a--;
			break;
        }
    }
    for(int i=0; i<a; i++)
	{
	   printf("%c",s2[i]);
	}
    printf("\n");
}

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
a.cc:8:12: error: 'strlen' was not declared in this scope
    8 |         s1=strlen(s);
      |            ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<string>
  +++ |+#include <cstring>
    3 | char s[101],s2[101];
Language: C++

/*#include<cstdio>
#include<string.h>
char str[101],answer[101];
int lens,i,lena=0;
int main()
{
    gets(str);
	lens=strlen(str),
    for(i=0;i<lens;i++)
        switch(str[i])
        {
            case '0':answer[lena]='0';lena++;break;
            case '1':answer[lena]='1';lena++;break;
            case 'B':if(lena!=0) lena--;break;
        }
    for(i=0;i<lena;i++)printf("%c",answer[i]);
    printf("\n");
}*/

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

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

int main(){
    int i, len;
    string n, result;
    cin >> n;
    len = n.length();
    for(i=0; i < 10; i++){
        cout << n[i] << endl;
        if((n[i] == '0') or (n[i] == '1') or (n[i] == 'B')){
            if((n[i] == '0') or (n[i] == '1')){
                result += n[i];
            } else {
                if(result.length() == 0){
                    continue;
                }else(result = result.substr(0, result.size()-1));
            }
        }else(continue;)
    }
    cout << result << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: expected primary-expression before 'continue'
   20 |         }else(continue;)
      |               ^~~~~~~~
a.cc:20:15: error: expected ')' before 'continue'
   20 |         }else(continue;)
      |              ~^~~~~~~~
      |               )
a.cc:20:24: error: expected primary-expression before ')' token
   20 |         }else(continue;)
      |                        ^
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main(){
	string s;
  	int i=0;
  	while(cin>>s){
    	if(s[i]=='0')s.push('0');
      	else if(s[i]=='1')s.push('1');
      	else s.pop_back();
    }
  	cout<<s<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'push'
   10 |         if(s[i]=='0')s.push('0');
      |                        ^~~~
a.cc:11:29: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'push'
   11 |         else if(s[i]=='1')s.push('1');
      |                             ^~~~
Language: C++

#include<iostream>
#include<bits/stdc++.h>

using namespace std;

int main(){
  string s, ans;
  int N = s.size();
  ans = "";
  for(int i = 0, i < N; i++){
    if( s.at(i) != 'B'){
      ans = ans + s.at(i);
    }
    else if(ans.size() > 1 && s.at(i) == 'B'){
      int a = ans.size();
      string X = "";
      for(int j=0; j<a-1; j++){
        X = X + ans.at(j);
      }
      ans = X;
    }
    else{
      ans = "";
    }
  }
  cout << ans << endl;
}
        
        
        

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '<' token
   10 |   for(int i = 0, i < N; i++){
      |                   ^~
      |                   ;
a.cc:10:20: error: expected primary-expression before '<' token
   10 |   for(int i = 0, i < N; i++){
      |                    ^
Language: C++

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

int main()
{
  string ttt;
  cin >> ttt;
  string ans = "99999999999";
  int a = 0;
  for(int i = 0; i < ttt.size(); i++) {
    switch(ttt.at(i)) {
      case '0':
        ans.at(a) = '0';
        a++;
        break;
      case '1';
        ans.at(a) = '1';
        a++;
        break;
      case 'B';
        ans.at(a) = '9';
        if(a > 0)
          a--;
        break;
    }
  }
  int i = 0;
  while(ans.at(i) != 'B') {
    cout << ans.at(i);
    i++;
  }
  cout << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: expected ':' before ';' token
   17 |       case '1';
      |               ^
      |               :
a.cc:21:15: error: expected ':' before ';' token
   21 |       case 'B';
      |               ^
      |               :
Language: C++

#include<stdio.h>
 
int main(){
  char s[100],k = 'B';
  scanf("%s",&s);
  for(int i = 1;i < strlen(s);i++){
    if(s[i] == k){
      int j = i - 1;
      while(s[j] == k && j > 0){
        j--;
      }
      s[j] = k;
    }
  }
  for(int i = 0;i < strlen(s);i++){
    if(s[i] != k){
      printf("%c",s[i]);
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: 'strlen' was not declared in this scope
    6 |   for(int i = 1;i < strlen(s);i++){
      |                     ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 | 
a.cc:15:21: error: 'strlen' was not declared in this scope
   15 |   for(int i = 0;i < strlen(s);i++){
      |                     ^~~~~~
a.cc:15:21: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

using namespace std;

int main(void){
    string str;
    cin >> str;

    string ans="";

    for(int i=0; i<str.size(); i++){
        if(str[i]=='0') ans+='0';
        if(str[i]=='1') ans+='1';
        if(str[i]=='B'){
            if(!str.empty()) ans.pop_back();
        }
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'string' was not declared in this scope
    4 |     string str;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> str;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:5:12: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |     cin >> str;
      |            ^~~
      |            std
a.cc:7:11: error: expected ';' before 'ans'
    7 |     string ans="";
      |           ^~~~
      |           ;
a.cc:10:25: error: 'ans' was not declared in this scope
   10 |         if(str[i]=='0') ans+='0';
      |                         ^~~
a.cc:11:25: error: 'ans' was not declared in this scope
   11 |         if(str[i]=='1') ans+='1';
      |                         ^~~
a.cc:13:30: error: 'ans' was not declared in this scope
   13 |             if(!str.empty()) ans.pop_back();
      |                              ^~~
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << ans << endl;
      |     ^~~~
a.cc:17:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:13: error: 'ans' was not declared in this scope
   17 |     cout << ans << endl;
      |             ^~~
a.cc:17:20: error: 'endl' was not declared in this scope
   17 |     cout << ans << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C

#include<stdio.h>

int main(){
  int len = 0, i = 0;
  char s[11], t[11];
  
  scanf("%s", s);
  while(s[len]){
    if(s[len] == '0'){
      t[i++] = 0;
    } else if(s[len] == '1'){
      t[i++] = 1;
    } else if(s[len] == 'B'){
      if(i != 0){
        t[--i] = '\0';
      }
    }
    len++;
  }
  
  for (j = i; j >= 0; j--){
    printf("%c", t[i]);
  }
  printf("\n");
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:8: error: 'j' undeclared (first use in this function)
   21 |   for (j = i; j >= 0; j--){
      |        ^
main.c:21:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;

int main()
{
    char s[11];
    cin >> s;
    char ans[11];
    int flag=0;
    int i = strlen(s);
    for (int j=0; j<i; j++){
        if(s[j]=='0'){
            ans[flag]='0';
            flag++;
        }else if(s[j]=='1'){
            ans[flag]='1';
            flag++;
        }else if(flag!=0){
            flag--;
            ans[flag]='\0';
        }
    }
    cout << ans << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'strlen' was not declared in this scope
   10 |     int i = strlen(s);
      |             ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C

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

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

#include<stdio.h>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<queue>
#include<algorithm>
#include<iostream>
using namespace std;
int main()
{
    char ch[10000];
    cin>>ch;
    int len = strlen(ch);
    int l = 100;
    int r = 101;
    int ans[1000];
    for(int i= 0;i<len;i++)
    {
        if(ch[i]=='0')
        {
            ans[l] = 0;
            l--;
        }
        else if(ch[i] == '1')
        {
            ans[r] = 1;
            r++;
        }
        else if(ch[i]=='B')
        {
            if(r==l+1)
            continue;
            r--;

        }
    }
    for(int i = l +1;i<r;i++)
        cout<<ans[i];
    return 0;


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

#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
int main() {
    char a[100];
    gets(a);
    int n = strlen(a);
    char b[100];
    int j = 0;
    for(int i = 0; i < n; i++) {
        if(a[i] == '0')
            b[j++] = '0';
        if(a[i] == '1')
            b[j++] = '1';
        if(a[i] == 'B') {
            if(j == 0)
                continue;
            else
                j--;
        }
    }
    if(j == 0)
        printf("\n");
    else {
        for(int i = 0; i <= j; i++)
            printf("%c", b[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(a);
      |     ^~~~
      |     getw
Language: C

#include <cstdio>
#include <cstring>
int main(){
	char s[105];
	char ch[105];
	int cnt=0;
	scanf("%s",s);
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='B'&&i>0){
			s[i-1]='B';
		}
	}
	for(int i=0;i<=strlen(s);i++){
		if(s[i]=='B')cnt++;
		else ch[i-cnt]=s[i];
	}
	printf("%s\n",ch);
}


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

#include <cstdio>
#include <cstring>
int main(){
	char s[15];
	for(int i=0;i<15;i++){
		scanf("%c",&s[i]);
		if(s[i]=='B'&&i>0){i-=2;continue;}
		if(s[i]=='\n')break;
	}
	for(int i=0;i<strlen(s);i++){
		printf("%c",s[i]);
	}
	return 0;
}


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

#include<stdio.h>
#include<string.h>
#define N 11
	char str[N];
	char end[N];
int main()
{
	int i,len;
	gets(str);
	len = strlen(str);
	for(i=0 ; i<len ; i++)
	{
		if(str[i]=='0') end[i]='0';
		if(str[i]=='B') end[i]='\b';
		if(str[i]=='1') end[i]='1';
	}
	printf("%s\n",end);
	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(str);
      |         ^~~~
      |         getw
Language: C++

#include<stdio.h>
#include<string.h>
#define N 99
	char str[N];
	char end[N];
int main()
{
	int i,len;
	gets(str);
	len = strlen(str);
	for(i=0 ; i<len ; i++)
	{
		if(str[i]=='0') end[i]='0';
		if(str[i]=='B') end[i]='\b';
		if(str[i]=='1') end[i]='1';
	}
	printf("%s\n",end);
	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(str);
      |         ^~~~
      |         getw
Language: C

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

int main() {
    char s[11] = { 0 };
    char t[11] = { 0 };
    int p = 0;

    scanf("%s", s);

    for (int i = 0; i < strlen(s); i++) {
        if (s[i] == 'B') {
            if (p != 0) {
                p--;
            }
        } else {
            t[p++] = s[i];
        }
    }
    t[p] = '\0';
    printf("%s\n", t);
    return 0;


Compiler output:
main.c: In function 'main':
main.c:22:5: error: expected declaration or statement at end of input
   22 |     return 0;
      |     ^~~~~~
Language: C++

#include<bits/stdc++.h>
int main()
{
    char str[101],ans[101];
    gets(str);
    int i,lena=0;
    for(i=0;i<strlen(str);i++)
        switch(str[i])
        {
            case '0':
				ans[lena]='0';
				lena++;
				break;
            case '1':
				ans[lena]='1';
				lena++;
				break;
            case 'B':
				if(lena!=0) lena--;
				break;
        }
    for(i=0;i<lena;i++)
        printf("%c",ans[i]);
    printf("\n");
    return 0;
}

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

#include <bits/stdc++.h>
char str[101],answer[101];
int main()
{
    
    gets(str);
    int lens=strlen(str),i,lena=0;
    for(i=0;i<lens;i++)
        switch(str[i])
        {
            case '0':answer[lena]='0';lena++;break;
            case '1':answer[lena]='1';lena++;break;
            case 'B':if(lena!=0) lena--;break;
    for(i=0;i<lena;i++)
        printf("%c",answer[i]);
    printf("\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |     gets(str);
      |     ^~~~
      |     getw
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Stack;

public class AtCoderAbc043A {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String word = input.readLine();
        Stack<Character> characters = new Stack<>();

        for (int i = 0; i < word.length(); i++) {
            if (word.charAt(i) == 'B' && !characters.isEmpty()){
                characters.pop();
            }else if (word.charAt(i) == '1' || word.charAt(i) == '0'){

                characters.push(word.charAt(i));
            }
        }

        StringBuilder out = new StringBuilder();

        for (int i = 0; i < characters.size(); i++) {
            out.append(characters.get(i));
        }

        System.out.println(out);
    }
}


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

#include<cstdio>
#include<cstring>
char stop,ans[12],c[12]; 
int len,str;
int main()
{int s;
scanf("%s",c);
len=strlen(c);
	for(int i=1;i<=len;i++)
	{
			stop=c[i];
		if(stop=='B')
		{if(str>0)
			{
			str--;
			ans[str]='\0';
		}}
	else{ans[str]=stop;
			str++; 	
		}
	}
printf("%s",ans);

}

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

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

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

  if (s.at(0) != 'B') {
    cout << s.at(0);
  }
  for (int i = 1; i < n - 1; i ++) {
    if (s.at(i + 1) != 'B' || s.at(i) != 'B') {
      cout << s.at(i);
    }
  }
  if (s.at(s.size() - 1) != 'B') {
    cout << s.at(s.size() - 1);
  }
  cout << endl;
}


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

#include <iostream>
#include<cstring>
using namespace std;
int main()
{
	char str[101], answer[101];
	gets(str);
	int lens = strlen(str), i, lena = 0;
	for (i = 0; i < lens; i++)
		switch (str[i])
	{
		case '0':answer[lena] = '0'; lena++; break;
		case '1':answer[lena] = '1'; lena++; break;
		case 'B':if (lena != 0) lena--; break;
	}
	for (i = 0; i < lena; i++)
		printf("%c", answer[i]);
	printf("\n");
}


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(str);
      |         ^~~~
      |         getw
Language: C++

#include <iostream>
using namespace std;
int main()
{
	char str[101], answer[101];
	gets(str);
	int lens = strlen(str), i, lena = 0;
	for (i = 0; i < lens; i++)
		switch (str[i])
	{
		case '0':answer[lena] = '0'; lena++; break;
		case '1':answer[lena] = '1'; lena++; break;
		case 'B':if (lena != 0) lena--; break;
	}
	for (i = 0; i < lena; i++)
		printf("%c", answer[i]);
	printf("\n");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |         gets(str);
      |         ^~~~
      |         getw
a.cc:7:20: error: 'strlen' was not declared in this scope
    7 |         int lens = strlen(str), i, lena = 0;
      |                    ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:8:14: error: 'i' was not declared in this scope
    8 |         for (i = 0; i < lens; i++)
      |              ^
a.cc:11:33: error: 'lena' was not declared in this scope; did you mean 'lens'?
   11 |                 case '0':answer[lena] = '0'; lena++; break;
      |                                 ^~~~
      |                                 lens
a.cc:15:14: error: 'i' was not declared in this scope
   15 |         for (i = 0; i < lena; i++)
      |              ^
a.cc:15:25: error: 'lena' was not declared in this scope; did you mean 'lens'?
   15 |         for (i = 0; i < lena; i++)
      |                         ^~~~
      |                         lens
Language: C++

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

map<string, int> mp;

int main() {
    string s;
    cin >> s;
    vector<char> ans;
   
    
    for (int i = 0; i < s.size();i++) {
        if (s[i] == '0') {
            ans.push_back('0');
        }
        if (s[i] == '1') {
            ans.push_back('1');
        }
        
         if (ans.size() >= 1 && s[i] == 'B') {
             ans.pop_back();
    }
         for (int i = 0; i < ans.size();i++) {
             cout << ans[i];
       }
    }
    cout << endl;
}

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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <thread>
#include <chrono>
#include <queue>

using namespace std;

int main(void){
	string s;
	queue<char> q;
	cin >> s;
	for(int i=0;i<s.length();i++){
		if(s.at(i)=='0'){
			q.push('0');
		}else if(s.at(i)=='1'){
			q.push('1');
		}else{
			if(!(i==0)){
				q.push(' ');
			}
		}
	}
	for(int i=q.size();i>=0;i--){
		cout << q[i];
		q.pop();
	}
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: no match for 'operator[]' (operand types are 'std::queue<char>' and 'int')
   29 |                 cout << q[i];
      |                          ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <thread>
#include <chrono>
#include <queue>

using namespace std;

int main(void){
	string s;
	queue<char> q;
	cin >> s;
	for(int i=0;i<s.length();i++){
		if(s.at(i)=='0'){
			q.push('0');
		}else if(s.at(i)=='1'){
			q.push('1');
		}else{
			if(!(i==0)){
				q.push(' ');
			}
		}
	}
	for(int i=q.size();i>=0;i--){
		cout << q[i];
		q.pop;
	}
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: no match for 'operator[]' (operand types are 'std::queue<char>' and 'int')
   29 |                 cout << q[i];
      |                          ^
a.cc:30:19: error: invalid use of non-static member function 'void std::queue<_Tp, _Sequence>::pop() [with _Tp = char; _Sequence = std::deque<char, std::allocator<char> >]'
   30 |                 q.pop;
      |                 ~~^~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:9:
/usr/include/c++/14/bits/stl_queue.h:316:7: note: declared here
  316 |       pop()
      |       ^~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
 
int main() {
  string s, t;
  cin >> s;
  
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 0) t += "0";
    if (s[i] == 1) t += "1";
    if (s[i] == "B") t.pop_back();
  }
  cout << t;
  return 0;
}

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

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

int main() {
  string s, t;
  cin >> s;
  
  for (int i = 0; i < s.sixe(); i++) {
    if (s[i] == 0) t += "0";
    if (s[i] == 1) t += "1";
    if (s[i] == "B") t.pop_back();
  }
  cout << t;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sixe'; did you mean 'size'?
   10 |   for (int i = 0; i < s.sixe(); i++) {
      |                         ^~~~
      |                         size
a.cc:13:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if (s[i] == "B") t.pop_back();
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

int main() {
  string s, t;
  cin >> s;
  
  for (int i = 0; i < s.sixe(); i++) {
    if (s[i] == 0) t += "0";
    if (s[i] == 1) t += "1";
    if (s[i] == "B") t.pop_back();
  }
  cout << t;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s, t;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> s;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:10: error: 's' was not declared in this scope
    7 |   cin >> s;
      |          ^
a.cc:10:20: error: 't' was not declared in this scope
   10 |     if (s[i] == 0) t += "0";
      |                    ^
a.cc:11:20: error: 't' was not declared in this scope
   11 |     if (s[i] == 1) t += "1";
      |                    ^
a.cc:12:22: error: 't' was not declared in this scope
   12 |     if (s[i] == "B") t.pop_back();
      |                      ^
a.cc:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout << t;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:11: error: 't' was not declared in this scope; did you mean 'tm'?
   14 |   cout << t;
      |           ^
      |           tm
Language: C++

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

int main() {
  string str, ans;
  cin >> str;
  for (auto s : str) {
    if (s != 'B')
      ans += s;
    else if (!ans.empty()) {
      auto it = ans.end();
      ans.erace(--it);
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'erace'; did you mean 'erase'?
   13 |       ans.erace(--it);
      |           ^~~~~
      |           erase
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<string>
#include<vector>
#include<tuple>
#include<stack>
#include<iomanip>
#include<map>
using namespace std;

int main() {
	string s;
	int i,n;
	cin >> s;
	n = strlen (s);
	i = 0;
	while (s[i] == 'B') {
		s[i] = 2;
		i++;
	}
	int j;
	for (j = i; j < n; j++) {
		if (s[j] == 'B') { s[j] = 2; s[j - 1] = 2; }
	}
	for (j = 0; j < n; j++) {
		if (s[j] != '2')cout << s[j];
	}
	cout << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'strlen' was not declared in this scope
   17 |         n = strlen (s);
      |             ^~~~~~
a.cc:11:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include<map>
  +++ |+#include <cstring>
   11 | using namespace std;
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<string>
#include<vector>
#include<tuple>
#include<stack>
#include<iomanip>
#include<map>
using namespace std;

int main() {
	string s;
	int i,n;
	cin >> s;
	n = strlen (s);
	i = 0;
	while (s[i] == 'B') {
		s[i] == 2;
		i++;
	}
	int j;
	for (j = i; j < n; j++) {
		if (s[j] == 'B') { s[j] = 2; s[j - 1] = 2; }
	}
	for (j = 0; j < n; j++) {
		if (s[j] != '2')cout << s[j];
	}
	cout << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'strlen' was not declared in this scope
   17 |         n = strlen (s);
      |             ^~~~~~
a.cc:11:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include<map>
  +++ |+#include <cstring>
   11 | using namespace std;
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<string>
#include<vector>
#include<tuple>
#include<stack>
#include<iomanip>
#include<map>
using namespace std;

int main() {
	string s;
	int i,n;
	cin >> s;
	n = strlen(s);
	i = 0;
	while (s[i] == 'B') {
		s[i] == 2;
		i++;
	}
	int j;
	for (j = i; j < n; j++) {
		if (s[j] == 'B') { s[j] = 2; s[j - 1] = 2; }
	}
	for (j = 0; j < n; j++) {
		if (s[j] != '2')cout << s[j];
	}
	cout << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'strlen' was not declared in this scope
   17 |         n = strlen(s);
      |             ^~~~~~
a.cc:11:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include<map>
  +++ |+#include <cstring>
   11 | using namespace std;