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

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

signed main(){
    string s;
    cin >> s;
    string ans;
    REP(i,s.size()){
        if(s[i] == 'B' && ans.size > 0) ans.pop_back();
        else{
            ans += s[i];
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:31: 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 '()' ?)
   15 |         if(s[i] == 'B' && ans.size > 0) ans.pop_back();
      |                           ~~~~^~~~
      |                                   ()
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
signed main(){
  string a,b="";
  cin>>a;
  rep(i,a.size()){
    if(a.at(i)=='0')
      b+='0';
  if(a.at(i)=='1')
    b+='1';
  else{
    if(b!="")
    b.pop_back;
    }
  }
  cout<<b;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: 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>]'
   18 |     b.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 rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main(){
  string s;
  cin>>s;
  char ans[10];
  rep(i,s.size()){
    if(s[i]=='B'){
      ans=s.substr(0,i-1);
    }
    else ans+=s[i];
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: incompatible types in assignment of 'std::__cxx11::basic_string<char>' to 'char [10]'
   19 |       ans=s.substr(0,i-1);
      |       ~~~^~~~~~~~~~~~~~~~
a.cc:21:13: error: incompatible types in assignment of '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'char [10]'
   21 |     else ans+=s[i];
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main(){
  string s;
  cin>>s;
  rep(i,s.size()){
    if(s[i]=='B'&&s[i-1]!=nullptr){
      s[i-1]=nullptr;
    }
  }
  rep(i,s.size())cout<<s[i];
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'std::nullptr_t' to binary 'operator!='
   17 |     if(s[i]=='B'&&s[i-1]!=nullptr){
a.cc:18:14: error: cannot convert 'std::nullptr_t' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
   18 |       s[i-1]=nullptr;
      |              ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main(){
  string s;
  cin>>s;
  rep(i,s.size()){
    if(s[i]=='B'&&s[i-1]!=nullptr){
      s[i-1]==nullptr;
    }
  }
  rep(i,s.size())cout<<s[i];
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'std::nullptr_t' to binary 'operator!='
   17 |     if(s[i]=='B'&&s[i-1]!=nullptr){
a.cc:18:13: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'std::nullptr_t' to binary 'operator=='
   18 |       s[i-1]==nullptr;
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main(){
  string s;
  cin>>s;
  rep(i,s.size()){
    if(s[i]=='B'&&s[i-1]!=''){
      s[i-1]=='';
    }
  }
  rep(i,s.size())cout<<s[i];
  
}

Compiler output:
a.cc:17:27: error: empty character constant
   17 |     if(s[i]=='B'&&s[i-1]!=''){
      |                           ^~
a.cc:18:15: error: empty character constant
   18 |       s[i-1]=='';
      |               ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main(){
  string s;
  cin>>s;
  rep(i,s.size()){
    if(s[i]=='B'&&(s[i-1]=='0'||s[i-1]=='1'||s[i-1]=='B')){
      s[i-1]=='';
    }
  }
  rep(i,s.size())cout<<s[i];
}

Compiler output:
a.cc:18:15: error: empty character constant
   18 |       s[i-1]=='';
      |               ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main(){
  string s;
  cin>>s;
  rep(i,s.size()){
    if(s[i]=='B'&&(s[i-1]=='0'||s[i-1]=='1'||s[i-1]=='B')){
      s[i-1]=='';
    }
  rep(i,s.size())cout<<s[i];
}

Compiler output:
a.cc:18:15: error: empty character constant
   18 |       s[i-1]=='';
      |               ^~
a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:13:11: note: to match this '{'
   13 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string s,ss;
  int k=0;
  cin >> s;
  for(int i=0;i<s.length();i++){
  if(s[i]=='B')
  {  k=k-1;
    
    if(k<0)
      =0;}
    else
      ss[k++]=s[i];
  }
  cout << ss;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: expected primary-expression before '=' token
   12 |       =0;}
      |       ^
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
      String answer = "";
		Scanner scan = new Scanner(System.in);
      	String s = scan.next();
      	 int l = s.length();
     	 String[] moji = new String[];
      for(int i = 0;i < l;i++){
        moji[i]=s.charAt(i);
	}
      for(String　moji :moji){
        boolean is0 = moji.equals("0");
        boolean is1 = moji.equals("1");
        boolean isB = moji.equals("B");
        boolean isAns0 = answer.length()==0;
        
        if(is0){
          answer += "0";
        }else if(is1){
          answer += "1";
        }else if(isB && !isAns0){
          answer = answer.substring(answer.length()-1);
        }
      }
        System.out.println(answer);
}

Compiler output:
Main.java:9: error: array dimension missing
     	 String[] moji = new String[];
     	                             ^
Main.java:13: error: illegal character: '\u3000'
      for(String?moji :moji){
                ^
Main.java:13: error: not a statement
      for(String?moji :moji){
          ^
Main.java:13: error: not a statement
      for(String?moji :moji){
                       ^
Main.java:13: error: ';' expected
      for(String?moji :moji){
                           ^
Main.java:28: error: reached end of file while parsing
}
 ^
6 errors
Language: C++

#include <bits/stdc++.h>
#define int long long
using namespace std;
 
signed main(){
	string a,b;
	cin>>a;
	for(int i=0;i<a.size();i++)
		if(a.at(i)=='0')
		b+='0';
	if(a.at(i)=='1')
		b+='1';
	if(a.at(i)=='B'){
		if(b.size()>0)
			b.pop_back();
	}
	cout<<b<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'i' was not declared in this scope
   11 |         if(a.at(i)=='1')
      |                 ^
a.cc:13:17: error: 'i' was not declared in this scope
   13 |         if(a.at(i)=='B'){
      |                 ^
Language: C++

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

int main() {
  string s;
  cin >> s;
  vector<char> c;
  for(int i = 0; i < s.size; i++){
    if(s.at(i) == '0'){
      c.push_back('0');
    }else if(s.at(i) == '1'){
      c.push_back('1');
    }else{
      c.pop_back();
    }
  }
  for(int i : c){
    cout << i << endl;
  }
}


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

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

int main(){
  string s; cin>>s;
  string ans;
  for(int i=0;i<s.size();i++){
    if(s[i]=="B"){
      if(!ans.empty())ans.pop_back();
    }else ans.push_back(s[i]);
  }
  cout<<ans<<endl;
}


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

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

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


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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'stirng' was not declared in this scope
    6 |   stirng ans;
      |   ^~~~~~
a.cc:8:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |     if(!ans.empty)ans.pop_back();
      |         ^~~
      |         abs
a.cc:11:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   10 |       ans.push_back("1");
      |                     ^~~
      |                     |
      |                     const char*
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:1572:24: note:   initializing argument 1 of 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1572 |       push_back(_CharT __c)
      |                 ~~~~~~~^~~
a.cc:12:21: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   12 |       ans.push_back("0");
      |                     ^~~
      |                     |
      |                     const char*
/usr/include/c++/14/bits/basic_string.h:1572:24: note:   initializing argument 1 of 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1572 |       push_back(_CharT __c)
      |                 ~~~~~~~^~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  char s[1];
  vector<char>data;
  for(int i=0;i<11;i++){
    cin>>s[0];
    data.emplace_back(s[0]);
  }
  for(int i=0;i<data.size();i++){
    if(data[i]=='B'&&i!=0) data.erase(i-1);
  }
  for(int i=0;i<data.size();i++){
    cout<<data[i];
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:38: error: no matching function for call to 'std::vector<char>::erase(int)'
   14 |     if(data[i]=='B'&&i!=0) data.erase(i-1);
      |                            ~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = char; _Alloc = std::allocator<char>; iterator = std::vector<char>::iterator; const_iterator = std::vector<char>::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from 'int' to 'std::vector<char>::const_iterator'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = char; _Alloc = std::allocator<char>; iterator = std::vector<char>::iterator; const_iterator = std::vector<char>::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <fstream>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
#include <cstring>
#include <cctype>
#include <numeric>
#include <cstdio>
#include <math.h>
#include <functional>
using namespace std;
struct initon
{
    initon()
    {
        cin.tie(0);
        ios::sync_with_stdio(false);
    };
};
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvi = vector<vi>;
using vs = vector<string>;
using vl = vector<ll>;
using vvl = vector<vl>;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using vp = vector<P>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (i64 i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define RS(x) rsort(x.begin(),x,end()))
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()
#define fst first
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define sw swap
#define UP(x) transform(x.begin(), x.end(), x.begin(), ::toupper);
#define LOW(x) transform(x.begin(), x.end(), x.begin(), ::tolower);
#define na(a, n) rep(i, n) cin >> a[i];
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
vb d(10);
int ans(int x)
{
    while (x)
    {
        if (d[x % 10])
            return 0;
        x /= 10;
    }
    return 1;
}
//ここからメイン
int main()
{
    int a,b,c,n,d;
    string A,B,C,D,N;
    stack<int> an;
    cin >> A;
    for(const auto& i:B){
     if(i=='B'){
        if(A.size())A.pob();
        }else if(i=='0'){
     A.pb(0);
     }else if(i=='1'){
         A.pb(1);
     }
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:91:5: error: 'stack' was not declared in this scope
   91 |     stack<int> an;
      |     ^~~~~
a.cc:19:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
   18 | #include <functional>
  +++ |+#include <stack>
   19 | using namespace std;
a.cc:91:11: error: expected primary-expression before 'int'
   91 |     stack<int> an;
      |           ^~~
Language: C++

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

int main(int argc, char const *argv[])
{
    
    vector<char>c;
    string s;
    cin>>s;
    for(char i:s)
    {
        if(i=='0'||i=='1')
        {
            c.push_back(i);
        }
        else if(i=='B')
        {
            c.pop_back();
        }
    }
    for(int i=0;i<c.length();i++)
    {
        cout<<c[i];
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:22:21: error: 'class std::vector<char>' has no member named 'length'
   22 |     for(int i=0;i<c.length();i++)
      |                     ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s1,s2;
  cin>>s1;
  for(int i=0;i<s1.size();i++){
    if(s1.at(i)=='0') 
      if(s2.empty()) s2='0';
      else s2+'0'
    if(s1.at(i)=='1') 
      if(s2.empty()) s2='1';
      else s2+'1';
    else if(s2.size()!=0) s2.erase(s2.size()-1);
  }
  cout<<s2<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before 'if'
    9 |       else s2+'0'
      |                  ^
      |                  ;
   10 |     if(s1.at(i)=='1')
      |     ~~            
a.cc:9:15: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
    9 |       else s2+'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:3670:5: note: declared here
 3670 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
      |     ^~~~~~~~
a.cc:12:15: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   12 |       else s2+'1';
      |               ^~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: declared here
 3670 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
      |     ^~~~~~~~
a.cc:13:5: error: 'else' without a previous 'if'
   13 |     else if(s2.size()!=0) s2.erase(s2.size()-1);
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s1,s2;
  cin>>s1;
  for(int i=0;i<s1.size();i++){
    if(s1.at(i)=='0') s2+='0';
    if(s1.at(i)=='1') s2+='1';
    else s2.erase(s2.size-1)
  }
  cout<<s2<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: 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 '()' ?)
    9 |     else s2.erase(s2.size-1)
      |                   ~~~^~~~
      |                          ()
Language: C++

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

int main(void)
{
  string s;
  cin>>s;
  string n="";
  for(int i=0;i<s.length;i++){
    if(s.at(i)=='b')
      n.pop_back();
    else
      n.push_back(s[i]);
  }
  cout<<n<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |   for(int i=0;i<s.length;i++){
      |                 ~~^~~~~~
      |                         ()
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  char x;
  string a;
  while (x != NULL) {
    cin >> x;
    if (x == 1 || x == 0) {
      a.push_back(x);
    } else {
      a.clear(a.size() - 1);
    }
  }
  cout << a;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: warning: NULL used in arithmetic [-Wpointer-arith]
    6 |   while (x != NULL) {
      |               ^~~~
a.cc:11:14: error: no matching function for call to 'std::__cxx11::basic_string<char>::clear(std::__cxx11::basic_string<char>::size_type)'
   11 |       a.clear(a.size() - 1);
      |       ~~~~~~~^~~~~~~~~~~~~~
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:1222:7: note: candidate: 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::clear() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1222 |       clear() _GLIBCXX_NOEXCEPT
      |       ^~~~~
/usr/include/c++/14/bits/basic_string.h:1222:7: note:   candidate expects 0 arguments, 1 provided
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:10:10: error: 'a' undeclared (first use in this function)
   10 |     else a[m]=s[i];
      |          ^
main.c:10:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main() {
    string s;
    cin >> s;
    int n = s.size();
    string ans = "";

    rep(i, n) {
        if(s[i] == '0') {
            ans += "0";
        }
        else if(s[i] == '1') {
            ans += "1";
        }
        else if(s[i] == 'B') {
            int m = ans.size();
            if(m <= 1) {
                ans = "";
            }
            else if(1 < m) {
                ans = substr(0, m-1);
            }
        }
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:30:23: error: 'substr' was not declared in this scope
   30 |                 ans = substr(0, m-1);
      |                       ^~~~~~
Language: C++

#include <iostream>
#include<algorithm>
#include<string>
#include<vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <numeric>

using namespace std;

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


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

#include<bits/stdc++.h>
using namespace std;
string s;
int cnt=0;
char a[100005];
int main()
{
     cin>>s;
     for(int i=0;i<s.size();i++)
     {
        if(s[i]!='B')
		{
			a[++cnt]=s[i];	
		 } 
        else 
         {
            cnt--;
            if(cnt<0)
			{
			 	cnt=0;
         	}
     }
     for(int i=1;i<=cnt;i++)
     {
     	cout<<a[i];	
	 }
     cout<<"\n";
}

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

#include<cstring>
#include<cstdio>
using namespace std;
int main(){
  char key[100];
  char s[100];
  int x = 0;
  scanf("%s", key);
  
  for(int i=0; i>strlen(key); i++){
    if(key[i] == 'B'){
      if(x != 0)
        x--;
    }
    else{
        s[x] = key[i];
        x++;
    }
  }
  s[x] = '\0'
  printf("%s", s);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: expected ';' before 'printf'
   20 |   s[x] = '\0'
      |              ^
      |              ;
   21 |   printf("%s", s);
      |   ~~~~~~
Language: C++

#include<cstring>
#include<cstdio>
int main(){
  char key[100];
  char s[100];
  int x = 0;
  scanf("%s", key);
  
  for(int i=0; i>strlen(key); i++){
    if(key[i] == 'B'){
      if(x != 0)
        x--;
    }
      else{
        s[x] = key[i];
        x++;
      }
    }
  }
  printf("%s", s);
  
  return 0;
}

Compiler output:
a.cc:20:9: error: expected constructor, destructor, or type conversion before '(' token
   20 |   printf("%s", s);
      |         ^
a.cc:22:3: error: expected unqualified-id before 'return'
   22 |   return 0;
      |   ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include<cstring>
#include<cstdio>
int main(){
  char key[100];
  char s[100];
  int x = 0;
  scanf("%s", key);
  
  for(int i=0; i>strlen(key); i++){
    if(key[i]=="B"){
      if(x != 0)
        x--;
    }
      else{
        s[x] = key[i];
        x++;
      }
    }
  }
  printf("%s", s);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(key[i]=="B"){
      |        ~~~~~~^~~~~
a.cc: At global scope:
a.cc:20:9: error: expected constructor, destructor, or type conversion before '(' token
   20 |   printf("%s", s);
      |         ^
a.cc:22:3: error: expected unqualified-id before 'return'
   22 |   return 0;
      |   ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include<cstring>
#include<cstdio>
int main(){
  char key[100];
  char s[100];
  int x = 0;
  scanf("%s", key);
  
  for(int i=0; i>strlen(key); i++){
    if(key[i]="B"){
      if(x != 0){
        x--;
      }
      else{
        s[x] = key[i];
        x++;
      }
    }
  }
  printf("%s", s);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   10 |     if(key[i]="B"){
      |               ^~~
      |               |
      |               const char*
Language: C++

#include<cstdio>
int main(){
  char key[100];
  char s[100];
  int x = 0;
  scanf("%s", key);
  
  for(int i=0; i>strlen(key); i++){
    if(key[i]="B"){
      if(x != 0){
        x--;
      }
      else{
        s[x] = key[i];
        x++;
      }
    }  
  print("%s", s);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 'strlen' was not declared in this scope
    8 |   for(int i=0; i>strlen(key); i++){
      |                  ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<cstdio>
  +++ |+#include <cstring>
    2 | int main(){
a.cc:9:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
    9 |     if(key[i]="B"){
      |               ^~~
      |               |
      |               const char*
a.cc:18:3: error: 'print' was not declared in this scope; did you mean 'printf'?
   18 |   print("%s", s);
      |   ^~~~~
      |   printf
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

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

char pop_back(char *str)
{
    const int len = strlen(str);
    if( len == 0 ) {
        return '\0';      
    } else {
        char c = str[len-1];     
        str[len-1] = '\0';       
        return c;                      
    }
}

int main() {
    string s;
    cin >> s;
    string ans = "";

    for(int i = 0; i < s.size(); i++) {
        if(s[i] == '0') {
            ans.push_back('0');
        }
        else if(s[i] == '1') {
            ans.push_back('1');
        }
        else {
            if(ans == "") {
                continue;
            }
            else {
                pop_back(ans);
            }
        }
    }

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

Compiler output:
a.cc: In function 'char pop_back(char*)':
a.cc:8:21: error: 'strlen' was not declared in this scope
    8 |     const int len = strlen(str);
      |                     ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
a.cc: In function 'int main()':
a.cc:35:26: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
   35 |                 pop_back(ans);
      |                          ^~~
      |                          |
      |                          std::string {aka std::__cxx11::basic_string<char>}
a.cc:6:21: note:   initializing argument 1 of 'char pop_back(char*)'
    6 | char pop_back(char *str)
      |               ~~~~~~^~~
Language: C++

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

int main(void)
{
  cahr s[15];
  char tmp;
  int i=0;
  while(cin>>tmp){
    if(tmp=='B'){
      if(i>0){
        s[i-1]='\0';
        i--;
      }
    }
    else{
      s[i]=tmp;
      i++;
    }
  }
  for(inti=0;i<15;i++){
    if(s[i]=='0'||s[i]=='1')
      cout<<s[i];
  }
  cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cahr' was not declared in this scope; did you mean 'char'?
    6 |   cahr s[15];
      |   ^~~~
      |   char
a.cc:12:9: error: 's' was not declared in this scope
   12 |         s[i-1]='\0';
      |         ^
a.cc:17:7: error: 's' was not declared in this scope
   17 |       s[i]=tmp;
      |       ^
a.cc:21:7: error: 'inti' was not declared in this scope; did you mean 'int'?
   21 |   for(inti=0;i<15;i++){
      |       ^~~~
      |       int
a.cc:22:8: error: 's' was not declared in this scope
   22 |     if(s[i]=='0'||s[i]=='1')
      |        ^
Language: C++

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

int main(void)
{
  char s[10];
  char l[10]; 

  cin>>s;
  for(int i=0;i<strlen(s);i++){
    if(s[i]=='0')
      s.push_back('0');
    if(s[i]=='1')
      s.push_back('1');
    if(s[i]==' ')
      l[i-1]=' ';
  }
  cout<<l<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: request for member 'push_back' in 's', which is of non-class type 'char [10]'
   12 |       s.push_back('0');
      |         ^~~~~~~~~
a.cc:14:9: error: request for member 'push_back' in 's', which is of non-class type 'char [10]'
   14 |       s.push_back('1');
      |         ^~~~~~~~~
Language: C++

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

int main(void)
{
  string s;
  string l;
  cin>>s;
  for(int i=0;i<strlen(s);i++){
    if(s[i]=='0')
      s.push_back('0');
    if(s[i]=='1')
      s.push_back('1');
    if(s[i]==' ')
      l[i-1]=' ';
  }
  cout<<l<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
    9 |   for(int i=0;i<strlen(s);i++){
      |                        ^
      |                        |
      |                        std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

#include<iostream>
#include<string>

using namespace std;



int main(){
    char s[15];
    char tmp;
    int i = 0;
    while(cin >> tmp){
        if(tmp=='B'){
            if(i>0){
                s[i-1] ='\0';
                i--;
            }
        }
        else{
            s[i] = tmp;
            i++;
        }
    }
    for(int i=0;i<15;i++){
        if(s[i] == '0' || s[i] == '1'){
            cout << s[i];
    }
    cout << endl;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'string'
   11 |   string ans = "";
      |   ^~~~~~
a.cc:15:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |       ans += '0';
      |       ^~~
      |       abs
a.cc:17:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |       ans += '1';
      |       ^~~
      |       abs
a.cc:19:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |       if(ans.length())
      |          ^~~
      |          abs
a.cc:24:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'string'
   11 |   string ans = "";
      |   ^~~~~~
a.cc:19:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |       if(ans.length())
      |          ^~~
      |          abs
a.cc:24:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

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

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

Compiler output:
a.cc:15:14: error: empty character constant
   15 |       s[i-1]='';
      |              ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s,ans;
  cin>>s;
  for(int i=0;i<s.size();i++){
    if(s.at(i)=='0'||s.at(i)=='1'){ans+=s.at(i);}
    else{ans-=ans.at(ans.size()-1);}
  }
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: 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'})
    8 |     else{ans-=ans.at(ans.size()-1);}
      |          ~~~^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s,ans;
  cin>>s;
  for(int i=0;i<s.size();i++){
    if(s.at(i)=='0'||s.at(i)=='1'){ans+=s.at(i);}
    else{ans-=s.at(i-1);}
  }
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: 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'})
    8 |     else{ans-=s.at(i-1);}
      |          ~~~^~~~~~~~~~~
Language: C++

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

int main(){
  string s;
  cin >> s;
  vector<char> data;
  for(int i=0; i<s.size(); i++){
    if(s.at(i) == '0'){
      data.push_back(0);
    }else if(s.at(i) == '1'){
      data.push_back(1);
    }else{
      data.pop_back();
    }
  }
  for(int i=0; i<data.size(); i++){
    cout << data.at(i);
  }
  cout << endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlucde; did you mean #include?
    1 | #inlucde <bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string s;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #inlucde <bits/stdc++.h>
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> s;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlucde <bits/stdc++.h>
a.cc:6:10: error: 's' was not declared in this scope
    6 |   cin >> s;
      |          ^
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<char> data;
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #inlucde <bits/stdc++.h>
a.cc:7:10: error: expected primary-expression before 'char'
    7 |   vector<char> data;
      |          ^~~~
a.cc:10:7: error: 'data' was not declared in this scope
   10 |       data.push_back(0);
      |       ^~~~
a.cc:12:7: error: 'data' was not declared in this scope
   12 |       data.push_back(1);
      |       ^~~~
a.cc:14:7: error: 'data' was not declared in this scope
   14 |       data.pop_back();
      |       ^~~~
a.cc:17:18: error: 'data' was not declared in this scope
   17 |   for(int i=0; i<data.size(); i++){
      |                  ^~~~
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout << data.at(i);
      |     ^~~~
a.cc:18:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout << endl;
      |   ^~~~
a.cc:20:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:11: error: 'endl' was not declared in this scope
   20 |   cout << endl;
      |           ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlucde <bits/stdc++.h>
Language: C++

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

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

  string ans;
  for (int i = 0; i < s.size(); i++)
  {
    if (s.at(i) == '0')
      ans.push_back('0');
    else if (s.at(i) == '1')
      ans.push_back('1');
    else
      ans.pop_back;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: 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>]'
   17 |       ans.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;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
    7 |     for(int i = 0; i < s.length(): i ++) {
      |                    ^
a.cc:7:34: error: expected ';' before ':' token
    7 |     for(int i = 0; i < s.length(): i ++) {
      |                                  ^
      |                                  ;
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
a.cc:23:25: error: expected ')' before '}' token
   23 |     cout << ans << endl;
      |                         ^
      |                         )
   24 | }
      | ~                        
a.cc:7:8: note: to match this '('
    7 |     for(int i = 0; i < s.length(): i ++) {
      |        ^
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'for'
    9 |   for(int i = 0; i < s.size(); i++){
      |   ^~~
a.cc:9:18: error: 'i' was not declared in this scope
    9 |   for(int i = 0; i < s.size(); i++){
      |                  ^
Language: C++

#include <bits/stdc++.h>
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];
typedef long long int ll;
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:46: error: expected ';' before '}' token
   11 |         else if(s[i]!='B')ans.push_back(s[i])
      |                                              ^
      |                                              ;
   12 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];
typedef long long int ll;
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: 't' was not declared in this scope
   10 |         if(s[i]=='B'&&t.size()>0)t.pop_back();
      |                       ^
Language: C++

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

int main(){
    string s;
    cin>>s;
    vector<char> v;
    for(auto i: s){
        if(i=='0'){
            v.pb('0');
        }
        else if(i=='1'){
            v.pb('1');
        }
        else{
            if(v.size()>0){
                v.pop_back();
            }
        }
    }
    for(auto i:v){
        cout<<i;
    }
    cout<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'class std::vector<char>' has no member named 'pb'
   16 |             v.pb('0');
      |               ^~
a.cc:19:15: error: 'class std::vector<char>' has no member named 'pb'
   19 |             v.pb('1');
      |               ^~
Language: C++

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

int main()
{
	string str;
	cin>>str;
	char ch[11];
	int count=0;
	for(int i=0;i<str.length();i++){
		if(str[i]=='0') {
			count++;
			ch[count]=str[i],
		}
		if(str[i]=='1'){
			count++;
			ch[count]=str[i],
		} 
		if(str[i]=='B') {
			if(count==0)continue;
			else count--;
		}
		
	}
	for(int i=1;i<=count;i++){
		printf("%c",count[i]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected primary-expression before '}' token
   14 |                 }
      |                 ^
a.cc:18:17: error: expected primary-expression before '}' token
   18 |                 }
      |                 ^
a.cc:26:34: error: invalid types 'int[int]' for array subscript
   26 |                 printf("%c",count[i]);
      |                                  ^
Language: C++

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

int main()
{
	char str[11];
	gets(str);
	for(int i=0;i<strlen(str);i++){
		if(str[i]=='B')str[i]='x',str[i-1]='x';
	}
	for(int i=0;i<strlen(str);i++){
		if(str[i]=='x') continue;
		else
		cout<<str[i];
	}
	cout<<endl;
}

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 <bits/stdc++.h>
#include <numeric>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: ambiguous overload for 'operator+=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   11 |     s+=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)
      |       ^~~~~~~~