Language: C++

a#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD (1E9+7)
#define PI 3.1415926535897932384

std::ostream &operator<<(std::ostream &out, const vector<int> &tgt)
{
	string s;
	for (int i = 0; i<tgt.size(); i++) {
		s += (to_string(tgt[i]) + ((i != tgt.size() - 1) ? " " : ""));
	}
	out << s;
	return out;
}

int main() {
	string s,ans;
	cin >> s;
	rep(i, s.size()) {
		if (s[i] == 'B') {
			if (ans.size()) {
				ans.pop_back();
			}
		}
		else ans.push_back(s[i]);
	}
	cout << ans << endl;
}	


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | a#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'a' does not name a type
    1 | a#include <bits/stdc++.h>
      | ^
a.cc:4:12: error: 'vector' does not name a type
    4 | using vi = vector<int>;
      |            ^~~~~~
a.cc:5:13: error: 'vector' does not name a type
    5 | using vvi = vector<vi>;
      |             ^~~~~~
a.cc:6:12: error: 'vector' does not name a type
    6 | using vs = vector<string>;
      |            ^~~~~~
a.cc:7:13: error: 'map' does not name a type; did you mean 'mp'?
    7 | using msi = map<string, int>;
      |             ^~~
      |             mp
a.cc:8:13: error: 'map' does not name a type; did you mean 'mp'?
    8 | using mii = map<int, int>;
      |             ^~~
      |             mp
a.cc:9:13: error: 'pair' does not name a type
    9 | using psi = pair<string, int>;
      |             ^~~~
a.cc:10:13: error: 'pair' does not name a type
   10 | using pii = pair<int, int>;
      |             ^~~~
a.cc:11:14: error: 'valarray' does not name a type
   11 | using vlai = valarray<int>;
      |              ^~~~~~~~
a.cc:26:6: error: 'ostream' in namespace 'std' does not name a type
   26 | std::ostream &operator<<(std::ostream &out, const vector<int> &tgt)
      |      ^~~~~~~
a.cc:1:1: note: 'std::ostream' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | a#include <bits/stdc++.h>
a.cc: In function 'int main()':
a.cc:37:9: error: 'string' was not declared in this scope
   37 |         string s,ans;
      |         ^~~~~~
a.cc:38:9: error: 'cin' was not declared in this scope
   38 |         cin >> s;
      |         ^~~
a.cc:38:16: error: 's' was not declared in this scope; did you mean 'sc'?
   38 |         cin >> s;
      |                ^
      |                sc
a.cc:41:29: error: 'ans' was not declared in this scope
   41 |                         if (ans.size()) {
      |                             ^~~
a.cc:45:22: error: 'ans' was not declared in this scope
   45 |                 else ans.push_back(s[i]);
      |                      ^~~
a.cc:47:9: error: 'cout' was not declared in this scope
   47 |         cout << ans << endl;
      |         ^~~~
a.cc:47:17: error: 'ans' was not declared in this scope
   47 |         cout << ans << endl;
      |                 ^~~
a.cc:47:24: error: 'endl' was not declared in this scope
   47 |         cout << ans << endl;
      |                        ^~~~