Language: C++

#include <stdlib.h> 
using namespace std;

string S;
string S_0 = "0";
int len; 

string cut(string str){
	S_0 = str[0];
	string tmp = str.substr(1);
	return tmp;
}

int main(){
	int i=0;
	cin >> S;
	len = S.size();
	long long sum = stoll(S.c_str());
	string tmp = S;
	string tmp3 = S;
	for(int i=1; i<len; i++){
		sum += stoll(tmp.substr(0,i).c_str());
		string tmp2 = tmp.substr(i);
		sum += stoll(tmp2.c_str());
		int count = 0;
		while(tmp2.size()!=1){
			sum += stoll(tmp.substr(0,i).c_str());
			sum += count* stoll(S_0.substr());
			tmp2 = cut(tmp2);
			sum += stoll(S_0.substr());
			sum += stoll(tmp2.substr());
			count++;
		}
	}
	cout << sum << endl;
}

Compiler output:
a.cc:4:1: error: 'string' does not name a type
    4 | string S;
      | ^~~~~~
a.cc:5:1: error: 'string' does not name a type
    5 | string S_0 = "0";
      | ^~~~~~
a.cc:8:1: error: 'string' does not name a type
    8 | string cut(string str){
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:16:9: error: 'cin' was not declared in this scope
   16 |         cin >> S;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <stdlib.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:16:16: error: 'S' was not declared in this scope
   16 |         cin >> S;
      |                ^
a.cc:18:25: error: 'stoll' was not declared in this scope
   18 |         long long sum = stoll(S.c_str());
      |                         ^~~~~
a.cc:2:1: note: 'std::stoll' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include <stdlib.h>
  +++ |+#include <string>
    2 | using namespace std;
a.cc:19:9: error: 'string' was not declared in this scope
   19 |         string tmp = S;
      |         ^~~~~~
a.cc:19:9: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:20:15: error: expected ';' before 'tmp3'
   20 |         string tmp3 = S;
      |               ^~~~~
      |               ;
a.cc:22:30: error: 'tmp' was not declared in this scope
   22 |                 sum += stoll(tmp.substr(0,i).c_str());
      |                              ^~~
a.cc:23:23: error: expected ';' before 'tmp2'
   23 |                 string tmp2 = tmp.substr(i);
      |                       ^~~~~
      |                       ;
a.cc:24:30: error: 'tmp2' was not declared in this scope
   24 |                 sum += stoll(tmp2.c_str());
      |                              ^~~~
a.cc:28:45: error: 'S_0' was not declared in this scope
   28 |                         sum += count* stoll(S_0.substr());
      |                                             ^~~
a.cc:29:32: error: 'cut' was not declared in this scope; did you mean 'count'?
   29 |                         tmp2 = cut(tmp2);
      |                                ^~~
      |                                count
a.cc:35:9: error: 'cout' was not declared in this scope
   35 |         cout << sum << endl;
      |         ^~~~
a.cc:35:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:24: error: 'endl' was not declared in this scope
   35 |         cout << sum << endl;
      |                        ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <stdlib.h>
  +++ |+#include <ostream>
    2 | using namespace std;