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

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

//positionbit目が立っているか判定
bool contain(int mask, int position){
    if((mask & (1 << position)) != 0) return true;
    else return false;
}

int main(void){
    string s; cin >> s;
    int n = s.size() - 1;
    
    ll sum = 0;
    for(int mask = 0; mask < (1 << n); ++mask){
        int l = 0;//左端
        ll tmp = 0;
        int r;//右端
        for (r = 0; r < n; ++r){
            if(contain(mask, r)){
                string t = s.substr(l, r - l + 1);
                ll num = stoll(t);
                tmp += num;
                l = r + 1;
            }
        }
        string t = s.substr(l, r - l + 1);
        ll num = stoll(t);
        tmp += num;
        sum += tmp;
    }
    printf("%lld\n", sum);
    return 0;
}
mmxsrup (id:mmxsrup) 2年前

Compiler output:
a.cc:39:12: error: found ':' in nested-name-specifier, expected '::'
   39 | mmxsrup (id:mmxsrup) 2年前
      |            ^
      |            ::
a.cc:39:9: error: expected constructor, destructor, or type conversion before '(' token
   39 | mmxsrup (id:mmxsrup) 2年前
      |         ^
Language: C++

# -*- coding: utf-8 -*-

s = input()
n = len(s)
ans = 0

if n == 1:
    print(int(s))
    exit()

for i in range(2 ** (n - 1)):

    tmp = int(s[0])

    for j in range(n - 1):

        if (i >> j) & 1:
            ans += tmp
            tmp = 0

        tmp = tmp * 10 + int(s[j + 1])

    ans += tmp

print(ans)


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:3:1: error: 's' does not name a type
    3 | s = input()
      | ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  int a = N;
  
  int keta = 0;
  while (a > 0) {
    keta++;
    a /= 10;
  }
  int sum = N;
  for(int i = 1; i < keta; i++) {
    sum += pow(2, (keta - i - 1)) * (a % pow(10, i));
    sum += pow(2, (i - 1)) * (a / pow(10, i));
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:40: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   16 |     sum += pow(2, (keta - i - 1)) * (a % pow(10, i));
      |                                      ~ ^ ~~~~~~~~~~
      |                                      |      |
      |                                      int    __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
using namespace std;

typedef long long signed int ll;
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(obj) (obj).begin(),(obj).end()

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
string S;
vector<int> number;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin>>S;
	REP(i, S.length()) {
		number.push_back(atoi(S[S.length() - i - 1]));
	}
	int sum = 0;
	for (int bit = 0; bit < (1 << S.length()-1); ++bit) {
		int tmp = 1;
		REP(i, S.length() - 1) {
			if (!(bit | (1 << i))) {
				tmp *= 10;
			}
			sum+=number[i] * tmp;
		}
	}
	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:38: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   23 |                 number.push_back(atoi(S[S.length() - i - 1]));
      |                                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |                                      |
      |                                      __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
using namespace std;

typedef long long signed int ll;
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(obj) (obj).begin(),(obj).end()

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
string S;
vector<int> number;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin>>S;
	REP(i, S.length()) {
		number.push_back(atoi(S[S.length - i - 1]));
	}
	int sum = 0;
	for (int bit = 0; bit < (1 << S.length()-1); ++bit) {
		int tmp = 1;
		REP(i, S.length() - 1) {
			if (!(bit | (1 << i))) {
				tmp *= 10;
			}
			sum+=number[i] * tmp;
		}
	}
	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:43: 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 '()' ?)
   23 |                 number.push_back(atoi(S[S.length - i - 1]));
      |                                         ~~^~~~~~
      |                                                 ()
Language: C++

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

int main(){
string S;
cin >> S;
long long ans = 0;
for(int i = 0; s < (1 << (S.size() - 1)); i++){ 
     string now;
     now = S.at(0);
     for(int j = 0; j < S.size() - 1; j++){ 
          if(i & (1 << j)) now += "+";
          now += S.at(j + 1);
     }
    long long sum = 0;
    int pos = 0;
    while(now.find("+", pos) != string::npos){
        int nextpos = now.find("+" , pos);
        sum += stoll(now.substr(pos, nextpos - pos));
        pos = nextpos + 1;
    }
    sum += stoll(now.substr(pos));
    ans += sum;

}
cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 's' was not declared in this scope
    8 | for(int i = 0; s < (1 << (S.size() - 1)); i++){
      |                ^
Language: C++

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

int main() {
	ll a, b, c, d, e, f, g, h, i, j, n, m, l, sum = 0,aa[10];
	string s;
	cin >> s;
	l = s.size - 1;
	//rep(i, size(s))(cout << s[i]);
	rep(i, (1 << l)) {
		c = 0;
		d = int(s[0])-'0';
		rep(j,l){
			if (i & (1 << j)) {
		//		cout << d << "  ";
				c =c+ d;
				d = int(s[j + 1]) - '0';

			}
			else d = 10 * d + int(s[j + 1]) - '0';
			}

	//	cout << d << " "<< c+d<< "\n";
		sum = sum+ c + d;
	}

	cout << sum;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: 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 '()' ?)
   14 |         l = s.size - 1;
      |             ~~^~~~
      |                   ()
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))

#define REP0(i,n) for(i=0;i<n;i++)
#define REP1(i,n) for(i=1;i<n;i++)

int main(void)
{
  char s[11];
  int d[11];
  scanf("%s",s);
  int l;
  l = strlen(s);//\0を抜いた文字列の長さ
  int i,j;
  REP(i,l) d[i]=s[i]-'0';
  int ans=0,v;
  //+を入れるか入れないかをbit探索
  REP0(i,1<<l-1)//文字より一字少ない
  {
    v=d[0];
    REP0(j,l-1)
    {
      if((i>>j)&1)
      {
        v=v*10+d[j+1];
        
      }
      else
      {
        ans+=v;
         v=d[j+1];
        }
      }
      ans+=v;
    }
  
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'REP'; did you mean 'REP0'? [-Wimplicit-function-declaration]
   20 |   REP(i,l) d[i]=s[i]-'0';
      |   ^~~
      |   REP0
main.c:20:11: error: expected ';' before 'd'
   20 |   REP(i,l) d[i]=s[i]-'0';
      |           ^~
      |           ;
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))

#define REP0(i,n) for(i=0;i<n;i++)
#define REP1(i,n) for(i=1;i<n;i++)

int main(void)
{
  char s[11];
  int d[11];
  scanf("%s",s);
  int l;
  l = strlen(s);//\0を抜いた文字列の長さ
  int i,j;
  REP(i,l) d[i]=s[i]-'0';
  int ans=0,v;
  //+を入れるか入れないかをbit探索
  REP0(i,1<<l-1)//文字より一字少ない
  {
    v=d[0];
    REP0(j,l-1)
    {
      if((i>>j)&1)
      {
        v=v*10+d[j+1];
        
      }
      else
      {
        ans+=v;
         v=d[j+1];
        }
      }
      ans+=v
    }
  
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'REP'; did you mean 'REP0'? [-Wimplicit-function-declaration]
   20 |   REP(i,l) d[i]=s[i]-'0';
      |   ^~~
      |   REP0
main.c:20:11: error: expected ';' before 'd'
   20 |   REP(i,l) d[i]=s[i]-'0';
      |           ^~
      |           ;
main.c:39:13: error: expected ';' before '}' token
   39 |       ans+=v
      |             ^
      |             ;
   40 |     }
      |     ~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))

#define REP0(i,n) for(i=0;i<n;i++)
#define REP1(i,n) for(i=1;i<n;i++)

int main(void)
{
  char s[11];
  int d[11];
  scanf("%s",s);
  int l;
  l = strlen(s);//\0を抜いた文字列の長さ
  int i,j;
  REP(i,l) d[i]=s[i]-'0';
  int ans=0,v;
  //+を入れるか入れないかをbit探索
  REP0(i,1<<l-1)//文字より一字少ない
  {
    v=d[0];
    REP(j,l-1)
    {
      if((i>>j)&1)
      {
        v=v*10+d[j+1];
        
      }
      else
      {
        ans+=v;
         v=d[j+1];
        }
      }
      ans+=v
    }
  
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'REP'; did you mean 'REP0'? [-Wimplicit-function-declaration]
   20 |   REP(i,l) d[i]=s[i]-'0';
      |   ^~~
      |   REP0
main.c:20:11: error: expected ';' before 'd'
   20 |   REP(i,l) d[i]=s[i]-'0';
      |           ^~
      |           ;
main.c:26:15: error: expected ';' before '{' token
   26 |     REP(j,l-1)
      |               ^
      |               ;
   27 |     {
      |     ~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))

#define REP0(i,n) for(i=0;i<n;i++)
#define REP1(i,n) for(i=1;i<n;i++)

int main(void)
{
  char s[11];
  int d[11];
  scanf("%s",s);
  int l;
  l = strlen(s);//\0を抜いた文字列の長さ
  int i,j;
  REP(i,l) d[i]=s[i]-'0';
  int ans=0,v;
  //+を入れるか入れないかをbit探索
  REP0(i,1<<l-1)//文字より一字少ない
  {
    v=d[0];
    REP(j,l-1)
    {
      if((i>>j)&1)
      {
        v=v*10+d[j+1];
        
      }
      else
      {
        ans+=v;
         v=d[j+1];
        }
      }
    }
    ans+=v
  }
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'REP'; did you mean 'REP0'? [-Wimplicit-function-declaration]
   20 |   REP(i,l) d[i]=s[i]-'0';
      |   ^~~
      |   REP0
main.c:20:11: error: expected ';' before 'd'
   20 |   REP(i,l) d[i]=s[i]-'0';
      |           ^~
      |           ;
main.c:26:15: error: expected ';' before '{' token
   26 |     REP(j,l-1)
      |               ^
      |               ;
   27 |     {
      |     ~          
main.c:40:11: error: expected ';' before '}' token
   40 |     ans+=v
      |           ^
      |           ;
   41 |   }
      |   ~        
main.c: At top level:
main.c:42:10: error: expected declaration specifiers or '...' before string constant
   42 |   printf("%d",ans);
      |          ^~~~
main.c:42:15: error: unknown type name 'ans'
   42 |   printf("%d",ans);
      |               ^~~
main.c:43:3: error: expected identifier or '(' before 'return'
   43 |   return 0;
      |   ^~~~~~
main.c:44:1: error: expected identifier or '(' before '}' token
   44 | }
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))

#define REP0(i,n) for(i=0;i<n;i++)
#define REP1(i,n) for(i=1;i<n;i++)

int main(void)
{
  char s[11];
  int d[11];
  scanf("%s",s);
  int l;
  l = strlen(s);//\0を抜いた文字列の長さ
  int i,j;
  REP(i,l) d[i]=s[i]-'0';
  int ans=0,v;
  //+を入れるか入れないかをbit探索
  REP0(i,1<<l-1)//文字より一字少ない
  {
    v=d[0];
    REP(j,l-1)
    {
      if()(i>>j)&1)
      {
        v=v*10+d[j+1];
        
      }
      else
      {
        ans+=v;
         v=d[j+1];
        }
      }
    }
    ans+=v
  }
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'REP'; did you mean 'REP0'? [-Wimplicit-function-declaration]
   20 |   REP(i,l) d[i]=s[i]-'0';
      |   ^~~
      |   REP0
main.c:20:11: error: expected ';' before 'd'
   20 |   REP(i,l) d[i]=s[i]-'0';
      |           ^~
      |           ;
main.c:26:15: error: expected ';' before '{' token
   26 |     REP(j,l-1)
      |               ^
      |               ;
   27 |     {
      |     ~          
main.c: At top level:
main.c:40:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '+=' token
   40 |     ans+=v
      |        ^~
main.c:42:10: error: expected declaration specifiers or '...' before string constant
   42 |   printf("%d",ans);
      |          ^~~~
main.c:42:15: error: unknown type name 'ans'
   42 |   printf("%d",ans);
      |               ^~~
main.c:43:3: error: expected identifier or '(' before 'return'
   43 |   return 0;
      |   ^~~~~~
main.c:44:1: error: expected identifier or '(' before '}' token
   44 | }
      | ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#define ll long long
using namespace std;
ll stoll(string str)
{
    int len=str.size();
    ll sum=0;
    for(int i=0;i<len;i++)
    {
        sum=sum*10+(str[i]-'0');
    }
    return sum;
}
ll int search(string s1,ll presum){
	int i;
  	ll k,sum;
  	sum = 0;
  	for (i=1;i<=s1.size();i++){
      	string s2 = s1.substr(0,i);//[0,i)
      	string s3 = s1.substr(i);
      	if (s3==""){
        	s3 = "AC";//---//---//
        }
      	if(i == s1.size()){
        	sum += stoll(s1)+presum;//---
        }else{
            k = stoll(s2);//---
            if (s3=="AC"){
            	sum += k + presum;//-- 
            }else{
            	sum += search(s3,k + presum);
            }
        }
    }
  	return sum;//
}
int main(){
	ll sum;
  	string s;
  	cin >> s;
  	sum = search(s,0);//dfs
  	cout << sum;
  	return 0;
}


Compiler output:
a.cc: In function 'long long int search(std::string, long long int)':
a.cc:27:29: error: call of overloaded 'stoll(std::string&)' is ambiguous
   27 |                 sum += stoll(s1)+presum;//---
      |                        ~~~~~^~~~
a.cc:6:4: note: candidate: 'long long int stoll(std::string)'
    6 | ll stoll(string str)
      |    ^~~~~
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:4180:3: note: candidate: 'long long int std::__cxx11::stoll(const std::string&, std::size_t*, int)'
 4180 |   stoll(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~~
a.cc:29:22: error: call of overloaded 'stoll(std::string&)' is ambiguous
   29 |             k = stoll(s2);//---
      |                 ~~~~~^~~~
a.cc:6:4: note: candidate: 'long long int stoll(std::string)'
    6 | ll stoll(string str)
      |    ^~~~~
/usr/include/c++/14/bits/basic_string.h:4180:3: note: candidate: 'long long int std::__cxx11::stoll(const std::string&, std::size_t*, int)'
 4180 |   stoll(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
const int INF = 1e7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, k, n) for (int i = (k); i < (int)(n); ++i)
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(), (x).end()
#define pb push_back
int main()
{
    string s;
    cin >> s;
    int n = s.size() - 1;
    lint ans = 0;
    rep(i, 1 << n)
    {
        lint num = 0;
        lint cc = s[0] - '0';
        rep(j, n)
        {
            if ((i >> j) & 1)
            {
                num += cc;
                cc = s[j + 1] - '0';
            }
            else
            {
                cc *= 10;
                cc += s[j+1] - '0';
            }
        }
        num += cc;
        ans += num;
    }
    cout << ans << endl;
    return 0;
}#include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
const int INF = 1e7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, k, n) for (int i = (k); i < (int)(n); ++i)
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(), (x).end()
#define pb push_back
int main()
{
    string s;
    cin >> s;
    int n = s.size() - 1;
    lint ans = 0;
    rep(i, 1 << n)
    {
        lint num = 0;
        lint cc = s[0] - '0';
        rep(j, n)
        {
            if ((i >> j) & 1)
            {
                num += cc;
                cc = s[j + 1] - '0';
            }
            else
            {
                cc *= 10;
                cc += s[j+1] - '0';
            }
        }
        num += cc;
        ans += num;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc:41:2: error: stray '#' in program
   41 | }#include "bits/stdc++.h"
      |  ^
a.cc:41:3: error: 'include' does not name a type
   41 | }#include "bits/stdc++.h"
      |   ^~~~~~~
a.cc:43:11: error: redefinition of 'const int MOD'
   43 | const int MOD = 1e9 + 7;
      |           ^~~
a.cc:3:11: note: 'const int MOD' previously defined here
    3 | const int MOD = 1e9 + 7;
      |           ^~~
a.cc:45:11: error: redefinition of 'const int INF'
   45 | const int INF = 1e7;
      |           ^~~
a.cc:5:11: note: 'const int INF' previously defined here
    5 | const int INF = 1e7;
      |           ^~~
a.cc:53:5: error: redefinition of 'int main()'
   53 | int main()
      |     ^~~~
a.cc:13:5: note: 'int main()' previously defined here
   13 | int main()
      |     ^~~~
Language: C++

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

int search(string s1){
	int i,sum,k;
  	sum = 0;
  	std::string s3,s2;
  	for (i=1;i<=s1.size();i++){
      	s2 = s1.substr(0,i);
      	s3 = s1.substr(i);
      	if(s2 == ""){
        	s2 = "0";
      	k = stoi(s2);
      	sum += k + search(s3);
    }
  	return sum;
}
int main(void){
	int sum;
  	std::string s;
  	cin >> s;
  	sum = search(s);
  	printf("%d", sum);
  	return 0;
}

Compiler output:
a.cc: In function 'int search(std::string)':
a.cc:20:15: error: a function-definition is not allowed here before '{' token
   20 | int main(void){
      |               ^
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:6:22: note: to match this '{'
    6 | int search(string s1){
      |                      ^
a.cc:27:2: warning: control reaches end of non-void function [-Wreturn-type]
   27 | }
      |  ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=a;i<b;i++)
using namespace std;
using ll = long long;
int main() {
	string s;
	ll ans=sum=0;
	cin>>s;
	rep(i, 0, 1 << s.size()-1) {
		rep(j, 0, s.size()) {
			if (1 & i >> j)sum = sum*10 + (int)(s[j] - '0');
			else ans += sum * 10 + (int)(s[j] - '0'),sum=0;
		}
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'sum' was not declared in this scope
    7 |         ll ans=sum=0;
      |                ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
stack<int> d;
int i;
int dfs(a){
  if(i==d.size()) return a;
  return dfs(a*10+d[i+1])+a+dfs(d[i+1]);
}
int main(){
  long long s;
  cin>>s;
  for(int j=0;j<10;j++){
    if(s%10==0)break;
    d.push(s%10);
    s/=10;
  }
  reverse(d.begin(),d.end());
  cout<<dfs(d[0])<<endl;
}
    
    

Compiler output:
a.cc:5:9: error: 'a' was not declared in this scope
    5 | int dfs(a){
      |         ^
a.cc: In function 'int main()':
a.cc:17:13: error: 'class std::stack<int>' has no member named 'begin'
   17 |   reverse(d.begin(),d.end());
      |             ^~~~~
a.cc:17:23: error: 'class std::stack<int>' has no member named 'end'
   17 |   reverse(d.begin(),d.end());
      |                       ^~~
a.cc:18:14: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int')
   18 |   cout<<dfs(d[0])<<endl;
      |              ^
a.cc:18:17: error: 'dfs' cannot be used as a function
   18 |   cout<<dfs(d[0])<<endl;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
stack<int> d;
int i;
int dfs(a){
  if(i==d.size()) return a;
  return dfs(a*10+d[i+1])+a+dfs(d[i+1]);
}
int main(){
  int s;
  cin>>s;
  stack<int> d;
  for(int j=0;j<10;j++){
    if(s%10==0)break;
    d.push(s%10);
    s/=10;
  }
  reverse(d.begin(),d.end());
  cout<<dfs(d[0])<<endl;
}
    
    

Compiler output:
a.cc:5:9: error: 'a' was not declared in this scope
    5 | int dfs(a){
      |         ^
a.cc: In function 'int main()':
a.cc:18:13: error: 'class std::stack<int>' has no member named 'begin'
   18 |   reverse(d.begin(),d.end());
      |             ^~~~~
a.cc:18:23: error: 'class std::stack<int>' has no member named 'end'
   18 |   reverse(d.begin(),d.end());
      |                       ^~~
a.cc:19:14: error: no match for 'operator[]' (operand types are 'std::stack<int>' and 'int')
   19 |   cout<<dfs(d[0])<<endl;
      |              ^
a.cc:19:17: error: 'dfs' cannot be used as a function
   19 |   cout<<dfs(d[0])<<endl;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int a;
cin>>a;
int dfs (int i, int sum){
  if (a/i==0)return sum;
  else{
    sum+=dfs(10,a/i)
    sum+=dfs(10*i,a)
  }
}
int main(){
  cout<<dfs(10,0)<<endl;
}

Compiler output:
a.cc:4:1: error: 'cin' does not name a type
    4 | cin>>a;
      | ^~~
a.cc: In function 'int dfs(int, int)':
a.cc:8:21: error: expected ';' before 'sum'
    8 |     sum+=dfs(10,a/i)
      |                     ^
      |                     ;
    9 |     sum+=dfs(10*i,a)
      |     ~~~              
a.cc:8:8: warning: control reaches end of non-void function [-Wreturn-type]
    8 |     sum+=dfs(10,a/i)
      |     ~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int a;
cin>>a;
int dfs (int i, ){
  if (a/i==0)return sum;
  else{
    sum+=dfs(10,a/i)
    sum+=dfs(10*i,a)
  }
}
int main(){
  cout<<dfs(10,0)<<endl;
}

Compiler output:
a.cc:4:1: error: 'cin' does not name a type
    4 | cin>>a;
      | ^~~
a.cc:5:17: error: expected identifier before ')' token
    5 | int dfs (int i, ){
      |                 ^
a.cc: In function 'int dfs(int, int)':
a.cc:6:21: error: 'sum' was not declared in this scope
    6 |   if (a/i==0)return sum;
      |                     ^~~
a.cc:8:5: error: 'sum' was not declared in this scope
    8 |     sum+=dfs(10,a/i)
      |     ^~~
Language: C++

s = input()
space = len(s) - 1
ans = 0

for i in range(2 ** space):
    formula = s[0]
    for j in range(space):
        if (i >> j) & 1:
            formula += "+"
        formula += s[j + 1]
    ans += eval(formula)

print(ans)

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = input()
      | ^
Language: C++

#include <cstdlib>
using namespace std;
typedef long long ll;

#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)

 int main() {
    string S; cin >> S;
    int N = S.size();
    ll ans = 0;

    FOR(bit, 0, (1<<(N - 1))) {
        ll sum = 0;
        int x = 0;
        FOR(i, 0, N - 1) {
            if (bit & (1<<i)) {
                ll y = atoi(S.substr(x,i - x + 1).c_str());
                sum += y;
                x = i + 1;
            }
            
        }
        ll z = atoi(S.substr(x).c_str());
        sum += z;

        ans += sum;
    }
    
    printf("%d\n", ans);
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'string' was not declared in this scope
    8 |     string S; cin >> S;
      |     ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include <cstdlib>
  +++ |+#include <string>
    2 | using namespace std;
a.cc:8:15: error: 'cin' was not declared in this scope
    8 |     string S; cin >> S;
      |               ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <cstdlib>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:8:22: error: 'S' was not declared in this scope
    8 |     string S; cin >> S;
      |                      ^
a.cc:29:5: error: 'printf' was not declared in this scope
   29 |     printf("%d\n", ans);
      |     ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include <cstdlib>
  +++ |+#include <cstdio>
    2 | using namespace std;
Language: C++

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

char C[10];
int S[10];
int len;

int calc(int acc, int pos, int last, int delimiter) {
  if (delimiter == len) {
    return 0;
  }
  if (pos == len - 1) {
    auto after = 0;
    for (auto i = last; i < len; i++) {
      after = after * 10 + S[i];
    }
    return acc + after;
  } else {
    auto before = 0;
    for (auto i = last; i <= pos; i++) {
      before = before * 10 + S[i];
    }
    return calc(acc + before, pos + 1, pos + 1, delimiter + 1) +
           calc(acc, pos + 1, last, delimiter);
  }
}

int main() {
  scanf("%s\n", C);

  len = (int)strlen(C);

  for (auto i = 0; i < len; i++)
    S[i] = C[i] - '0';

  printf("%d\n", calc(0, 0, 0, 0));
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:14: error: 'strlen' was not declared in this scope
   36 |   len = (int)strlen(C);
      |              ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <iostream>
  +++ |+#include <cstring>
    5 | #include <string>
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  //bit全探索を用いる
  string S;
  cin >> S;
  long long int ans = 0;
  for (int bit = 0; bit < (1<<(S.size()-1)); bit++;) { //　Sの部分集合の全探索 (数と数の間について+が入るかどうかを全列挙)
      int s = 0; //考えている現在地
      for (int i=0; i<S.size()-1; i++) {
          if (bit & (1 << i)) { //iがbitに入るかどうか
              ans += stoll(S.substr(s, i - s + 1)); //+が入る部分までを加える
              s = i + 1; //+が入る位置の右隣まで現在地を進める
          }
      }
      ans += stoll(S.substr(s, S.size() - s));//最後に+が入った位置から最後の数字までを加える
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:51: error: expected ')' before ';' token
    9 |   for (int bit = 0; bit < (1<<(S.size()-1)); bit++;) { //　Sの部分集合の全探索 (数と数の間について+が入るかどうかを全列挙)
      |       ~                                           ^
      |                                                   )
a.cc:9:52: error: expected primary-expression before ')' token
    9 |   for (int bit = 0; bit < (1<<(S.size()-1)); bit++;) { //　Sの部分集合の全探索 (数と数の間について+が入るかどうかを全列挙)
      |                                                    ^
Language: C

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>

using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define amari (x) x % 1000000007;

#define fillInt(xs, x)        \
  for (int i = 0; i < x; i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < x; i++) \
    scanf("%ld", &xs[i]);
#define sortv(xs) sort(xs.begin(), xs.end());
#define sortvdi(xs) sort(xs.begin(), xs.end(), std::greater<int>());
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin();
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin();

long calc(string h, string rem, long res) {
  if (rem.empty() && h.empty()) return res;
  if (rem.empty()) return 0;
  string newH = h + rem.substr(0, 1);
  string newRem = rem.substr(1);
  long left =  calc("", newRem, res + stol(newH));
  long right = calc(newH, newRem, res);
  return left + right;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  string S;
  cin >> S;

  printf("%ld", calc("", S, 0L));
  
  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h> 
using namespace std;
int main(void){
    string s; cin>>s;
    long int bit,i,n,sum=0; n=s.size()-1; //125でn=2
    for(bit=0;bit<(1<<n);bit++){
        string str=s; int x=0;
        for(i=0;i<n;i++){
            string tmp;
            if(bit&(1<<i)){
                
                tmp=str.substr(x,i-1); 
                sum+=long(tmp);
                x=i;
            }
        }
        string tmp;
        tmp=str.substr(x,str.size());
        if(tmp.size()==1) sum+=tmp[0]-'0'; else
        sum+=stoll(tmp);
    }
    cout <<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'long int'
   13 |                 sum+=long(tmp);
      |                      ^~~~~~~~~
Language: C++

S = input()
op_cnt = len(S) - 1
ResSum = 0

for i in range(2**op_cnt):
    op = [""] * op_cnt
    for j in range(op_cnt):
        if((i >> j) & 1):
            op[op_cnt - 1 - j] = "+"

    formula = ""
    for p_S, p_o in zip(S, op + [""]):
        formula += (p_S + p_o)

    ResSum += eval(formula)

print(ResSum)

Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S = input()
      | ^
Language: C++

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


int main() {
  string S;
  cin >> S;
  int number[S.size()];

  for(int i=0;i<S.size();i++){
    number[i] = S%10;
    S /= 10;
  }
  
  int ans = 0;

  for(int i=0;i<(1<<S.size());i++){
    int temp = i;
    int factor = 1;
    ans += (number[0])
    for(int j=1;j<S.size();j++){

      if(temp&0b1){
        factor = 1;
      }else{
        factor *= 10;
      }

      temp >>= 1;

      ans += (number[j]*factor);
    }
  }


  cout << ans << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   15 |     number[i] = S%10;
      |                 ~^~~
      |                 | |
      |                 | int
      |                 std::string {aka std::__cxx11::basic_string<char>}
a.cc:16:7: error: no match for 'operator/=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   16 |     S /= 10;
      |     ~~^~~~~
a.cc:24:23: error: expected ';' before 'for'
   24 |     ans += (number[0])
      |                       ^
      |                       ;
   25 |     for(int j=1;j<S.size();j++){
      |     ~~~                
a.cc:25:17: error: 'j' was not declared in this scope
   25 |     for(int j=1;j<S.size();j++){
      |                 ^
Language: C++

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


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

  int ans = 0;

  for(int i=0;i<(1<<(S.size()-1));i++){
    int temp = i+(1<<S.size());
    int factor = 1;
    int j =S.size()-1;
    while(temp){
      ans += (stoi(S[j])*factor);
      factor*=10;
      j-=1;
      if(temp&0b1) {factor=1;}
      temp = (temp>>1);
    }
  }

  cout << ans << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:19: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   20 |       ans += (stoi(S[j])*factor);
      |               ~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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


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

  int ans = 0;

  for(int i=0;i<(1<<(S.size()-1));i++){
    int temp = i+(1<<S.size());
    int factor = 1;
    int j =S.size()-1;
    while(temp){
      ans += (atoi(S[j])*factor);
      factor*=10;
      j-=1;
      if(temp&0b1) {factor=1;}
      temp = (temp>>1);
    }
  }

  cout << ans << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:19: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   20 |       ans += (atoi(S[j])*factor);
      |               ~~~~^~~~~~
      |                   |
      |                   __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

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


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

  int ans = 0;

  for(int i=0;i<(1<<(S.size()-1));i++){
    int temp = i+(1<<S.size());
    int factor = 1;
    int j =S.size()-1;
    while(temp){
      ans += (S[j]*factor);
      factor*=10;
      j-=1;
      if(temp&0b1) {factor=1;}
      temp = (temp>>1)；
    }
  }

  cout << ans << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: expected ';' before '\U0000ff1b'
   24 |       temp = (temp>>1)；
      |                       ^~
      |                       ;
Language: C++

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


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

  int ans = 0;

  for(int i=0;i<(1<<(S.size()-1));i++){
    int temp = i+(1<<S.size());
    int factor = 1;
    int j =S.size()-1;
    while(temp){
      ans += (S[j]*factor);
      factor*=10;
      j-=1;
      if(temp&0b1) factor=1;
      temp = (temp>>1)；
    }
  }

  cout << ans << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: expected ';' before '\U0000ff1b'
   24 |       temp = (temp>>1)；
      |                       ^~
      |                       ;
Language: C++

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


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

  int ans = 0;

  for(int i=0;i<(1<<(S.size()-1));i++){
    int temp = i+(1<<S.size());
    int factor = 1;
    int j =S.size()-1;
    while(temp){
      ans += (S[j]*factor);
      factor*=10;
      j-=1;
      if(temp&0b1) factor=1;
      temp = temp>>1；
    }
  }

  cout << ans << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:20: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   24 |       temp = temp>>1；
      |                    ^~~
Language: C++

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


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

  int ans = 0;

  for(int i=0;i<(1<<(S.size()-1));i++){
    temp = i+(1<<S.size());
    int factor = 1;
    int j =S.size()-1;
    while(temp){
      ans += (S[j]*factor);
      factor*=10;
      j-=1;
      if(temp&0b1) factor=1;
      temp = temp>>1；
    }
  }

  cout << ans << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'temp' was not declared in this scope; did you mean 'tm'?
   16 |     temp = i+(1<<S.size());
      |     ^~~~
      |     tm
a.cc:24:20: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   24 |       temp = temp>>1；
      |                    ^~~
Language: C++

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

int main()
{
    string S;
    cin>>S;
    int N = s.size();
    int count = 0;
    for(i=0;i<N;++i){
        for(j=i;j<N;++j){
            count += stoi(S.substr(i,j-i+1));
        }
    }
    cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 's' was not declared in this scope
    8 |     int N = s.size();
      |             ^
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     for(i=0;i<N;++i){
      |         ^
a.cc:11:13: error: 'j' was not declared in this scope
   11 |         for(j=i;j<N;++j){
      |             ^
Language: C++

import sys
inp = sys.stdin.readline

S = inp().replace('\n', '')

cnt = 0
for i in range(1 << len(S)-1):
  tmp = S[0]
  for j in range(len(S)-1):
    if(((i >> j) & 1) == 1):
      tmp += '+'
    tmp += S[j+1]
  cnt += sum(map(int, tmp.split('+')))
print(cnt)

Compiler output:
a.cc:4:25: error: empty character constant
    4 | S = inp().replace('\n', '')
      |                         ^~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
typedef long long ll;
using namespace std;

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

  for（int t = 0; t <（1 <<（s.size（） -  1））; t ++）{
    ll num = s [0] -'0';
    for（int i = 0; i <s.size（） -  1; i ++）{
      如果（T＆（1 << i））的{
          ANS + = NUM​​;
          NUM = 0;
      }
      NUM = NUM​​ * 10 + S [I + 1]  - '0';
    }
    ANS + = NUM​​;
  }
  cout << ans << endl;
  返回0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'for\U0000ff08int' was not declared in this scope
   19 |   for（int t = 0; t <（1 <<（s.size（） -  1））; t ++）{
      |   ^~~~~~~~
a.cc:19:19: error: 't' was not declared in this scope
   19 |   for（int t = 0; t <（1 <<（s.size（） -  1））; t ++）{
      |                   ^
a.cc:19:22: error: '\U0000ff081' was not declared in this scope
   19 |   for（int t = 0; t <（1 <<（s.size（） -  1））; t ++）{
      |                      ^~~
a.cc:19:28: error: '\U0000ff08s' was not declared in this scope
   19 |   for（int t = 0; t <（1 <<（s.size（） -  1））; t ++）{
      |                            ^~~
a.cc:19:44: error: unable to find numeric literal operator 'operator""\U0000ff09\U0000ff09'
   19 |   for（int t = 0; t <（1 <<（s.size（） -  1））; t ++）{
      |                                            ^~~~~
a.cc:31:3: error: '\U00008fd4\U000056de0' was not declared in this scope
   31 |   返回0;
      |   ^~~~~
Language: C++

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<map>
#include<numeric>
#include<set>
#include<string>
#include<utility>
#include<vector>

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define per(i, a, n)  for(int i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define MAX 1000001
using namespace std;
typedef long long ll;
string s;

int main(){
  std::cin >> s;
  ll res = 0;
  rep(i,0,(1<<s.size()-1)){
    ll tmp = s[0]-'0';
    rep(j,1,s.size()){
      if(i&(1<<(j-1)){
        res+=tmp;
        tmp=0;
      }
      tmp*=10;
      tmp+=s[j]-'0';
    }
    res+=tmp;
  }
  std::cout << res << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:22: error: expected ';' before '{' token
   29 |       if(i&(1<<(j-1)){
      |                      ^
      |                      ;
a.cc:33:14: error: expected ')' before ';' token
   33 |       tmp*=10;
      |              ^
      |              )
a.cc:29:9: note: to match this '('
   29 |       if(i&(1<<(j-1)){
      |         ^
Language: C++

import Control.Applicative
import Text.Printf
import Debug.Trace

solve :: [Integer] -> Integer
solve [] = 0
solve [x] = x
solve (x:xs) = x*(2^((length xs) - 1)) + (solve xs) + (solve ((10*x+(xs!!0)):(tail xs)))

solve_sub :: Int->[Integer] -> Integer
solve_sub n [] = 0
solve_sub n [x] = x*2^n
solve_sub n (x:xs) = x*(2^n)*10^(length xs) + (1-5^(length xs))`div`(1-5)*x*2^(length xs - 1 + n) + (solve_sub (n+1) xs)
  
solve_ :: [Integer] -> Integer
solve_ l = solve_sub 0 l 

listize :: Integer->[Integer]
listize 0 = []
listize n = (listize $ n`div`10)++[(n`mod`10)]

main :: IO()
main = do
  n <- readLn
  -- O(2^N)
  printf "%d\n" $ solve $ listize n
  -- O(N)
  --printf "%d\n" $ solve $ listize n


Compiler output:
a.cc:13:64: error: stray '`' in program
   13 | solve_sub n (x:xs) = x*(2^n)*10^(length xs) + (1-5^(length xs))`div`(1-5)*x*2^(length xs - 1 + n) + (solve_sub (n+1) xs)
      |                                                                ^
a.cc:13:68: error: stray '`' in program
   13 | solve_sub n (x:xs) = x*(2^n)*10^(length xs) + (1-5^(length xs))`div`(1-5)*x*2^(length xs - 1 + n) + (solve_sub (n+1) xs)
      |                                                                    ^
a.cc:20:25: error: stray '`' in program
   20 | listize n = (listize $ n`div`10)++[(n`mod`10)]
      |                         ^
a.cc:20:29: error: stray '`' in program
   20 | listize n = (listize $ n`div`10)++[(n`mod`10)]
      |                             ^
a.cc:20:38: error: stray '`' in program
   20 | listize n = (listize $ n`div`10)++[(n`mod`10)]
      |                                      ^
a.cc:20:42: error: stray '`' in program
   20 | listize n = (listize $ n`div`10)++[(n`mod`10)]
      |                                          ^
a.cc:1:1: error: 'import' does not name a type
    1 | import Control.Applicative
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;
struct Grid{int x,y,t;};
struct Edge{int to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
  const ll Inf = llINF;const int MAX_V=1010;vector<ll>d;
  Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
  void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
  void add_edge(int from,int to,int cost){E[from-1].pb({to-1,cost});}
};
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int h,w,n;cin>>h>>w>>n;
  int cnt[100]={};
  vector<pair<int,int> >bl(n);
  map<pair<int,int>,int>MP2;
  for(int i=0;i<n;i++){
    cin>>bl[i].F>>bl[i].S;
    MP2[mp(bl[i].F,bl[i].S)]=1;
  }
  sort(ALL(bl));
  map<pair<int,int>,int >MP;
  for(int i=0;i<n;i++){
    int jl=max(1,bl[i].F-2),jr=min(bl[i].F,h-2);
    int kl=max(1,bl[i].S-2),kr=min(bl[i].S,w-2);
    for(int j=jl;j<=jr;j++){
      for(int k=kl;k<=kr;k++){
	if(MP[mp(j,k)]==0){
	  MP[mp(j,k)]=1;
	  int cntt=0;
	  for(int l=j;l<=j+2:l++)
	    for(int ll=k;ll<=k+2;ll++)
	      cntt+=MP2[mp(l,ll)];
	  cnt[cntt]++;
	}
      }
    }
  }
  int sum=0;
  for(int i=1;i<=9;i++)sum+=cnt[i];
  cout<<(ll)(h-2)*(w-2)-sum<<endl;
  for(int i=1;i<=9;i++)cout<<cnt[i]<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:23: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   44 |           for(int l=j;l<=j+2:l++)
      |                       ^
a.cc:44:29: error: expected ';' before ':' token
   44 |           for(int l=j;l<=j+2:l++)
      |                             ^
      |                             ;
a.cc:45:28: error: expected unqualified-id before '<=' token
   45 |             for(int ll=k;ll<=k+2;ll++)
      |                            ^~
a.cc:10:12: error: expected primary-expression before 'long'
   10 | #define ll long long
      |            ^~~~
a.cc:45:34: note: in expansion of macro 'll'
   45 |             for(int ll=k;ll<=k+2;ll++)
      |                                  ^~
a.cc:45:34: error: expected ')' before 'long'
   45 |             for(int ll=k;ll<=k+2;ll++)
      |                                  ^
      |                                  )
a.cc:44:14: note: to match this '('
   44 |           for(int l=j;l<=j+2:l++)
      |              ^
a.cc:45:36: error: expected unqualified-id before '++' token
   45 |             for(int ll=k;ll<=k+2;ll++)
      |                                    ^~
Language: C++

S = input()
s = len(S)
n = 0
for i in range(s):
    n+= int(S[i])*(10**(s-1-i))*2**i
lis = []
for i in range(s-1):
    lis.append(2**i)
for i in range(s-1):
    for j in range(s-1-i):
        n += int(S[i])*(10**(s-2-i-j))*(lis[i+j])
print(n)

Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S = input()
      | ^