Language: C++


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

vector<vector<ll>> fmr;
int ln;
const char* num;

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

void addFmr(int cnt, vector<ll> f) {

	if (cnt >= ln) {
		fmr.push_back(f);
		return;
	}

	vector<ll> v = f;
	int add = ctoi(num[cnt]);
	v[v.size() - 1] = v[v.size() - 1] * 10 + add;

	f.push_back(add);

	addFmr(cnt + 1, v);
	addFmr(cnt + 1, f);

	return;

}



int main() {



	string st;
	cin >> st;

	num = st.c_str();

	ll sum,tmp;
	int  ix = 0;
	sum = tmp = 0;

	while (num[ln] != '\0')
	{
		ln++;
	}


	vector<ll> f;
	f.push_back(ctoi(num[0]));
	addFmr(1, f);

	for (int i = 0;i < fmr.size();i++) {
		vector<ll> sp = fmr[i];
		tmp = 0;
		for (int k = 0; k < sp.size(); k++)
		{
			tmp += sp[k];
		}
		sum += tmp;
	}

	cout << sum << endl;
	return 0;
}



Compiler output:
a.cc:7:1: error: 'vector' does not name a type
    7 | vector<vector<ll>> fmr;
      | ^~~~~~
a.cc:18:22: error: 'vector' has not been declared
   18 | void addFmr(int cnt, vector<ll> f) {
      |                      ^~~~~~
a.cc:18:28: error: expected ',' or '...' before '<' token
   18 | void addFmr(int cnt, vector<ll> f) {
      |                            ^
a.cc: In function 'void addFmr(int, int)':
a.cc:21:17: error: 'fmr' was not declared in this scope
   21 |                 fmr.push_back(f);
      |                 ^~~
a.cc:21:31: error: 'f' was not declared in this scope
   21 |                 fmr.push_back(f);
      |                               ^
a.cc:25:9: error: 'vector' was not declared in this scope
   25 |         vector<ll> v = f;
      |         ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<iostream>
  +++ |+#include <vector>
    3 | #include<string>
a.cc:25:18: error: expected primary-expression before '>' token
   25 |         vector<ll> v = f;
      |                  ^
a.cc:25:20: error: 'v' was not declared in this scope
   25 |         vector<ll> v = f;
      |                    ^
a.cc:25:24: error: 'f' was not declared in this scope
   25 |         vector<ll> v = f;
      |                        ^
a.cc: In function 'int main()':
a.cc:59:9: error: 'vector' was not declared in this scope
   59 |         vector<ll> f;
      |         ^~~~~~
a.cc:59:9: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:59:18: error: expected primary-expression before '>' token
   59 |         vector<ll> f;
      |                  ^
a.cc:59:20: error: 'f' was not declared in this scope
   59 |         vector<ll> f;
      |                    ^
a.cc:63:28: error: 'fmr' was not declared in this scope
   63 |         for (int i = 0;i < fmr.size();i++) {
      |                            ^~~
a.cc:64:26: error: expected primary-expression before '>' token
   64 |                 vector<ll> sp = fmr[i];
      |                          ^
a.cc:64:28: error: 'sp' was not declared in this scope; did you mean 'st'?
   64 |                 vector<ll> sp = fmr[i];
      |                            ^~
      |                            st