Language: C++


#include<iostream>
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() {


	std::ifstream in("D:\\myDocHome\\AtCoderTest\\input.txt");
	std::cin.rdbuf(in.rdbuf());

	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:6:1: error: 'vector' does not name a type
    6 | vector<vector<ll>> fmr;
      | ^~~~~~
a.cc:17:22: error: 'vector' has not been declared
   17 | void addFmr(int cnt, vector<ll> f) {
      |                      ^~~~~~
a.cc:17:28: error: expected ',' or '...' before '<' token
   17 | void addFmr(int cnt, vector<ll> f) {
      |                            ^
a.cc: In function 'void addFmr(int, int)':
a.cc:20:17: error: 'fmr' was not declared in this scope
   20 |                 fmr.push_back(f);
      |                 ^~~
a.cc:20:31: error: 'f' was not declared in this scope
   20 |                 fmr.push_back(f);
      |                               ^
a.cc:24:9: error: 'vector' was not declared in this scope
   24 |         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 | using namespace std;
a.cc:24:18: error: expected primary-expression before '>' token
   24 |         vector<ll> v = f;
      |                  ^
a.cc:24:20: error: 'v' was not declared in this scope
   24 |         vector<ll> v = f;
      |                    ^
a.cc:24:24: error: 'f' was not declared in this scope
   24 |         vector<ll> v = f;
      |                        ^
a.cc: In function 'int main()':
a.cc:42:25: error: variable 'std::ifstream in' has initializer but incomplete type
   42 |         std::ifstream in("D:\\myDocHome\\AtCoderTest\\input.txt");
      |                         ^
a.cc:3:1: note: 'std::ifstream' is defined in header '<fstream>'; this is probably fixable by adding '#include <fstream>'
    2 | #include<iostream>
  +++ |+#include <fstream>
    3 | using namespace std;
a.cc:60:9: error: 'vector' was not declared in this scope
   60 |         vector<ll> f;
      |         ^~~~~~
a.cc:60:9: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:60:18: error: expected primary-expression before '>' token
   60 |         vector<ll> f;
      |                  ^
a.cc:60:20: error: 'f' was not declared in this scope
   60 |         vector<ll> f;
      |                    ^
a.cc:64:28: error: 'fmr' was not declared in this scope
   64 |         for (int i = 0;i < fmr.size();i++) {
      |                            ^~~
a.cc:65:26: error: expected primary-expression before '>' token
   65 |                 vector<ll> sp = fmr[i];
      |                          ^
a.cc:65:28: error: 'sp' was not declared in this scope; did you mean 'st'?
   65 |                 vector<ll> sp = fmr[i];
      |                            ^~
      |                            st