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

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

#define ll long long
#define LL long long
#define ULL unsigned long long 
#define ull unsigned long long 
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)


using namespace std;

int main()
{
	char str[110] = {};
	int len;
	bool flag = true;
	int count = 0;
	while (cin >> str) {
		len=strlen(str);
		if (len % 2 != 0) {
			for (int i = 0; i < (len - 1)/2; i++) {
				if (str[i] != str[(len - 1) - i]) {
					flag = false;
				}
			}
			if (flag == true) {
				count++;
			}
		}
		else {

		}
	}
	cout << count << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:21: error: 'strlen' was not declared in this scope
   27 |                 len=strlen(str);
      |                     ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<algorithm>
  +++ |+#include <cstring>
    7 |
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
	string a;
	int count = 0;
	while(cin >> a;){
		string b = a;
		reverse(b.begin(),b.end());
		if(a == b) count++;
	}
	cout << count << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: expected ')' before ';' token
    8 |         while(cin >> a;){
      |              ~        ^
      |                       )
a.cc:8:24: error: expected primary-expression before ')' token
    8 |         while(cin >> a;){
      |                        ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
	string a;
	int count = 0;
	while(cin >> a){
		string b = a;
		reverse(b.begin(),b.end());
		if(a == b) count++;
	}
	cout << count << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'reverse' was not declared in this scope
   10 |                 reverse(b.begin(),b.end());
      |                 ^~~~~~~
Language: C++

//#define scanf_s scanf
#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 51
int main(void)
{
	char str[MAX];
	int i, j, cou = 0;
	while (scanf_s("%s",str) != EOF) {
		++cou;
		for (i = 0; str[i] != '\0'; ++i);
		for (j = 0; j < i / 2; ++j) {
			if (str[j] != str[i - 1 - j]) {
				--cou; break;
			}
		}
	}
	printf("%d\n", cou);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |         while (scanf_s("%s",str) != EOF) {
      |                ^~~~~~~
      |                scanf
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
  string s,g;
  int k=0;
  while(cin>>s){
    g=s;
    reverse(s.begin() , s.end() );
    if(g==s)k++;
  }
  cout<<k<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'reverse' was not declared in this scope
   10 |     reverse(s.begin() , s.end() );
      |     ^~~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;

int main() {
	string sa;
	int co = 0;
	while (cin >> sa) {
		int a = sa.size();
		if (a == 1) { co++; }
		string sb, sc;
		for (int i = 0; i < a / 2; i++) {
			sb[i] = sa[i];
		}
		
		int j = 0;
		if (a % 2 == 0) {
			for (int i = a / 2 + 1; i < a; i++) {
				sc[j] = sa[i];
				j++;
			}		
		}
		else {
			for (int i = 0; i < a;i++) {
				sc[j] = sa[i+(a/2)];
			}
		}
		reverse(sc.begin(),sc.end());
		if (sb == sc) {++co; }
	}
	cout << co << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'reverse' was not declared in this scope
   28 |                 reverse(sc.begin(),sc.end());
      |                 ^~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main() {
    string st;
    string origin;
    int cnt = 0;

    while (cin >> st) {
        origin = st;
        reverse(st.begin(), st.end());
        if (st == origin) cnt++;
    }
    cout << cnt << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'reverse' was not declared in this scope
   12 |         reverse(st.begin(), st.end());
      |         ^~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;


int main()
{
	string s,t; int n=0;
	while(cin >> s)
	{
		t=s;
		reverse(t.begin(), t.end());
		if(s==t)n++;
	}
	cout << n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'reverse' was not declared in this scope
   12 |                 reverse(t.begin(), t.end());
      |                 ^~~~~~~
Language: C++

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


int main(){
	char ss[100];
	int i,c;
	c=0;
	while(0<=scanf("%s",ss)){
/*		for(i=0;i<=strlen(ss)-1;i++){
			if(ss[i]!=ss[strlen(ss)-i-1])break;
		}
		
		if(i==strlen(ss)-1)++c;
	}
*/	printf("%d\n",c);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	string pal;
	int count = 0;
	
	while(cin >> pal){
		bool ispalin = true;
		int l = pal.length;		
		for(int i=0;i*2 < l-1;i++) if(pal[i] != pal[l-1-i]) {ispalin = false;break;}
		if(ispalin) count++;
	}
	
	cout << count << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:29: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
   12 |                 int l = pal.length;
      |                             ^~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

int main()
{
  string str;
  int c = 0;
  while (cin >> str) {
    cin.ignore();
    string S, R;
    S = substr(0, str.size() / 2);
    if (str.size() % 2 == 0) {
      R = substr(str.size() / 2, str.size() / 2);
    } else {
      R = substr(str.size() / 2 + 1, str.size() / 2);
    }
    if (S == R) {c++;}
  }
  printf("%d\n", c);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'substr' was not declared in this scope
   14 |     S = substr(0, str.size() / 2);
      |         ^~~~~~
Language: C++

#include <stdio.h>
int main(){
    int i,len,cnt=0;
    char input[1000];
    while(scanf("%s",input)!=EOF){
        if(input==EOF)break;
        len=strlen(input);
        int sw=1;
        for(i=0;i<len/2;i++){
            if(input[i]!=input[len-1-i]){
                sw=0;
                break;
            }
        }
        if(sw==1)cnt++;
    }
    printf("%d\n",cnt);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    6 |         if(input==EOF)break;
      |                 ^
a.cc:7:13: error: 'strlen' was not declared in this scope
    7 |         len=strlen(input);
      |             ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 | int main(){
Language: C++

#include <iostream>
#include <cstring>
#include <string>
using namespace std;

int main(){
    int cnt;
    string s;
    cnt = 0;
    while(cin >> s){
        string c = s;
        reverse(c.begin(),c.end());
        if(c == s) cnt++;
    }
    cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'reverse' was not declared in this scope
   12 |         reverse(c.begin(),c.end());
      |         ^~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

int check(string a,string b){
  if(a == b) return 1;
  return 0;
}

int main(void){
  string str;
  int cnt = 0;

  while(cin >> str){
    int flg = 0;
    
    for(int i = 0 ; i < str.size()/2 ; i++){
      if(!check(str[i],str[str.size()-i-1]){
        flg = 1;
        break;
      }
    }

  if(flg == 0) cnt++;
  }

  cout << cnt << endl; 

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: could not convert 'str.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))' from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   18 |       if(!check(str[i],str[str.size()-i-1]){
      |           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                |
      |                __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
a.cc:18:44: error: expected ')' before '{' token
   18 |       if(!check(str[i],str[str.size()-i-1]){
      |         ~                                  ^
      |                                            )
a.cc:22:5: error: expected primary-expression before '}' token
   22 |     }
      |     ^
Language: C++

#include <iostream>
#include <string>
int main(){
	char c;
	int a=0;
	std::string s,x;
	for(;std::cin>>s>>c;){
		x=s;
		reverse(x.begin(),x.end());
		if (x==s) a++;
	}
	std::cout<<a<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'reverse' was not declared in this scope
    9 |                 reverse(x.begin(),x.end());
      |                 ^~~~~~~
Language: C++

/**
 * 
 */
import java.util.*;
/**
 * @author akira
 *
 */
class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int ans = 0;
		while(scan.hasNextLine()){
			String str = scan.nextLine();
			boolean b = true;
			for(int i = 0;i < str.length() / 2;i++){
				if(str.charAt(i) != str.charAt(str.length() - 1 - i)){
					b = false;
				}
			}
			if(b){
				ans++;
			}
		}
		System.out.println("" + ans);
	}

}

Compiler output:
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.*;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:14:15: error: expected ':' before 'static'
   14 |         public static void main(String[] args) {
      |               ^~~~~~~
      |               :
a.cc:14:33: error: 'String' has not been declared
   14 |         public static void main(String[] args) {
      |                                 ^~~~~~
a.cc:14:42: error: expected ',' or '...' before 'args'
   14 |         public static void main(String[] args) {
      |                                          ^~~~
a.cc:33:2: error: expected ';' after class definition
   33 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:16:17: error: 'Scanner' was not declared in this scope
   16 |                 Scanner scan = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:18:23: error: 'scan' was not declared in this scope
   18 |                 while(scan.hasNextLine()){
      |                       ^~~~
a.cc:19:25: error: 'String' was not declared in this scope
   19 |                         String str = scan.nextLine();
      |                         ^~~~~~
a.cc:20:25: error: 'boolean' was not declared in this scope; did you mean 'bool'?
   20 |                         boolean b = true;
      |                         ^~~~~~~
      |                         bool
a.cc:21:43: error: 'str' was not declared in this scope; did you mean 'std'?
   21 |                         for(int i = 0;i < str.length() / 2;i++){
      |                                           ^~~
      |                                           std
a.cc:23:41: error: 'b' was not declared in this scope
   23 |                                         b = false;
      |                                         ^
a.cc:26:28: error: 'b' was not declared in this scope
   26 |                         if(b){
      |                            ^
a.cc:30:17: error: 'System' was not declared in this scope
   30 |                 System.out.println("" + ans);
      |                 ^~~~~~
Language: C++

#include<iostream>int p(char*s){int l=strlen(s),i;for (i=l;i--;)if (s[i]!=s[l-i-1])return 0;return 1;}int c;int main(){char s[101];while (std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}

Compiler output:
a.cc:1:23: warning: extra tokens at end of #include directive
    1 | #include<iostream>int p(char*s){int l=strlen(s),i;for (i=l;i--;)if (s[i]!=s[l-i-1])return 0;return 1;}int c;int main(){char s[101];while (std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}
      |                       ^
a.cc:1:9: fatal error: iostream>in: No such file or directory
    1 | #include<iostream>int p(char*s){int l=strlen(s),i;for (i=l;i--;)if (s[i]!=s[l-i-1])return 0;return 1;}int c;int main(){char s[101];while (std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}int c;int main(){char s[101];while(std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}

Compiler output:
a.cc:1:23: warning: extra tokens at end of #include directive
    1 | #include<iostream>int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}int c;int main(){char s[101];while(std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}
      |                       ^
a.cc:1:9: fatal error: iostream>in: No such file or directory
    1 | #include<iostream>int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}int c;int main(){char s[101];while(std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}
int c;
int main(){char s[101];while(std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}

Compiler output:
a.cc: In function 'int p(char*)':
a.cc:2:21: error: 'strlen' was not declared in this scope
    2 | int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}
      |                     ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}
a.cc:2:37: error: 'i' was not declared in this scope
    2 | int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}
      |                                     ^
Language: C++

#include<iostream>
#include<stdio.h>
int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}
int c;
int main(){char s[101];while(std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}

Compiler output:
a.cc: In function 'int p(char*)':
a.cc:3:21: error: 'strlen' was not declared in this scope
    3 | int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}
      |                     ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<stdio.h>
a.cc:3:37: error: 'i' was not declared in this scope
    3 | int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}
      |                                     ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int c;
int main(){

	for (string s, t; getline(cin, s), t = s,reverse(t.begin(),t.end()),s=="\0";)
		c += (s == t);


	cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:50: error: 'reverse' was not declared in this scope
    7 |         for (string s, t; getline(cin, s), t = s,reverse(t.begin(),t.end()),s=="\0";)
      |                                                  ^~~~~~~
Language: Java

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

int main(void)
{
	char str[100][100];
	int i, j, k, sum, mul;
	
	i = 0;
	sum = 0;
	while (scanf("%s" , str[i]) != EOF){
		for (j = 0; j < strlen(str[i]); j++){
			if (str[i][j] >= '0' && str[i][j] <= '9'){
				mul = 1;
				for (k = 1; str[i][j+k] - '0' >= 0 && str[i][j+k] - '0' <= 9; k++){
					mul *= 10;
					//printf("%d >%d\n", mul, j);
				}
				sum += (str[i][j] - '0') * mul;
			}
		}
		i++;
	}
	
	printf("%d\n", sum);
	
	return (0);
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:2: error: illegal character: '#'
#include <string.h>
^
Main.java:7: error: class, interface, enum, or record expected
	int i, j, k, sum, mul;
	^
Main.java:9: error: class, interface, enum, or record expected
	i = 0;
	^
Main.java:10: error: class, interface, enum, or record expected
	sum = 0;
	^
Main.java:11: error: class, interface, enum, or record expected
	while (scanf("%s" , str[i]) != EOF){
	^
Main.java:12: error: class, interface, enum, or record expected
		for (j = 0; j < strlen(str[i]); j++){
		            ^
Main.java:12: error: class, interface, enum, or record expected
		for (j = 0; j < strlen(str[i]); j++){
		                                ^
Main.java:15: error: class, interface, enum, or record expected
				for (k = 1; str[i][j+k] - '0' >= 0 && str[i][j+k] - '0' <= 9; k++){
				^
Main.java:15: error: class, interface, enum, or record expected
				for (k = 1; str[i][j+k] - '0' >= 0 && str[i][j+k] - '0' <= 9; k++){
				            ^
Main.java:15: error: class, interface, enum, or record expected
				for (k = 1; str[i][j+k] - '0' >= 0 && str[i][j+k] - '0' <= 9; k++){
				                                                              ^
Main.java:18: error: class, interface, enum, or record expected
				}
				^
Main.java:20: error: class, interface, enum, or record expected
			}
			^
Main.java:23: error: class, interface, enum, or record expected
	}
	^
Main.java:27: error: class, interface, enum, or record expected
	return (0);
	^
Main.java:28: error: class, interface, enum, or record expected
}
^
17 errors
Language: Java


public class Main {

	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		StringBuilder builder = new StringBuilder();
		String line;
		int count = 0;
		while ((line = reader.readLine()) != null) {
			Pattern pattern = Pattern.compile("([0-9]+)");
			Matcher matcher = pattern.matcher(line);
			while(matcher.find()){
				count+= Integer.parseInt(matcher.group());
			}
		}
		System.out.println(count);
	}

}

Compiler output:
Main.java:5: error: cannot find symbol
			IOException {
			^
  symbol:   class IOException
  location: class Main
Main.java:6: error: cannot find symbol
		BufferedReader reader = new BufferedReader(new InputStreamReader(
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
		BufferedReader reader = new BufferedReader(new InputStreamReader(
		                            ^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
		BufferedReader reader = new BufferedReader(new InputStreamReader(
		                                               ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:12: error: cannot find symbol
			Pattern pattern = Pattern.compile("([0-9]+)");
			^
  symbol:   class Pattern
  location: class Main
Main.java:12: error: cannot find symbol
			Pattern pattern = Pattern.compile("([0-9]+)");
			                  ^
  symbol:   variable Pattern
  location: class Main
Main.java:13: error: cannot find symbol
			Matcher matcher = pattern.matcher(line);
			^
  symbol:   class Matcher
  location: class Main
7 errors
Language: Java

import java.io.*;

class Main{
public static void main(Sting[] args) throws IOException{
BufferedReader br=new BfferedReader(new InputStreamReader(System.in));
String line="";
int count=0;
while((line=br.readLine())!=null){
int a=0;
boolean f=false;
for(int i=0;i<line.length();i++){
f=false;
if(line.charAt(i)>='0'&&line.charAt(i)<='9'){
a=a*10+(int)(line.charAt(i)-'0');
f=true;
}
if(!f){
count+=a;
a=0;
}
}
}
System.out.println(count);
}
}

Compiler output:
Main.java:4: error: cannot find symbol
public static void main(Sting[] args) throws IOException{
                        ^
  symbol:   class Sting
  location: class Main
Main.java:5: error: cannot find symbol
BufferedReader br=new BfferedReader(new InputStreamReader(System.in));
                      ^
  symbol:   class BfferedReader
  location: class Main
2 errors
Language: Java

package Vol000;
import java.util.Scanner;

public class AOJ0_64 
{
	public static void main(String arg[])
	{
		Scanner in = new Scanner(System.in);
		int count =0;
		String tmp = "0";
		while(in.hasNext())
		{
			char ch[]=in.nextLine().toCharArray();
			for(int i=0; i<ch.length; i++)
			{
				while(i<ch.length&&(Character.isDigit(ch[i])))
				{
					tmp+=ch[i];
					i++;
				}
				count+=Integer.valueOf(tmp);
				tmp="0";
			}
		}
		System.out.println(count);
	}
}

Compiler output:
Main.java:4: error: class AOJ0_64 is public, should be declared in a file named AOJ0_64.java
public class AOJ0_64 
       ^
1 error
Language: C

#include <stdio.h>int a, b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;}

Compiler output:
main.c:1:19: warning: extra tokens at end of #include directive
    1 | #include <stdio.h>int a, b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;}
      |                   ^~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;}

Compiler output:
main.c: In function 'main':
main.c:1:26: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;}
      |                          ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;}
main.c:1:26: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;}
      |                          ^~~~~
main.c:1:26: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:50: error: 'EOF' undeclared (first use in this function)
    1 | int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;}
      |                                                  ^~~
main.c:1:50: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:1:50: note: each undeclared identifier is reported only once for each function it appears in
main.c:1:61: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;}
      |                                                             ^~~~~~
main.c:1:61: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:61: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:61: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<string.h>
#include<ctype.h>
#include<math.h>
int main(void) {
	char str[81];
	int count = 0,length,i,j=0,k=0;

	while (scanf("%s",str) != EOF)
	{
		length = strlen(str);
		for (i = length - 1; i >= 0; i--) {
			if (isdigit(str[i])) {
				j = 0;
				while (1) {
					if (isdigit(str[i - j])) {
						count += (str[i - j]-'0') * (pow(10, j));
						k++;
					}
					else {
						i -= k;
						break;
					}
					j++;
				}
			}
		}
	}
	printf("%d\n",count);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    8 |         while (scanf("%s",str) != EOF)
      |                ^~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    3 | #include<math.h>
  +++ |+#include <stdio.h>
    4 | int main(void) {
main.c:8:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    8 |         while (scanf("%s",str) != EOF)
      |                ^~~~~
main.c:8:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:35: error: 'EOF' undeclared (first use in this function)
    8 |         while (scanf("%s",str) != EOF)
      |                                   ^~~
main.c:8:35: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:8:35: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   28 |         printf("%d\n",count);
      |         ^~~~~~
main.c:28:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:28:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:28:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

int func(int);

int t;
char str[81];

int main(void){

  int ans,i;

  memset(str,'a',sizeof(str));
  ans=0;
  while(~scanf("%[^\n]%*c",str)){
    for(i=0;i<strlen(str);i++)
      if(str[i]-'0'<10 && str[i]-'0'>=0){
	ans+=func(i);
	printf("%d\n",res);
	i=t;
      }

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

int func(int a){
  int x=0,i;
  for(i=a;str[i]-'0'<10;i++){
    if(i!=a)x*=10;
    x+=str[i]-'0';
  }
  t=i;
  return x;
}

Compiler output:
main.c: In function 'main':
main.c:19:23: error: 'res' undeclared (first use in this function)
   19 |         printf("%d\n",res);
      |                       ^~~
main.c:19:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C

/*


*/


#include <stdio.h>
#include <string.h>
#include <ctype.h>


int mystrtol(char text[], char **pEnd, int value);


int main(void){
	
	char text[101];
	int sum;
	int i, temp;
	char *pStart;
	char *pEnd;
	
	while(fgets(text, sizeof(text), stdin) != NULL){
		
		i = 0;
		pStart = text;
		
		text[strlen(text)-1] = '\0';
		
		while(pStart[i] != '\0'){
			
			if(isdigit(pStart[i])){
				
				temp = mystrtol(pStart+i, &pEnd, 10);
				//printf("temp = %d\n", temp);
				
				pStart = pEnd;
				i = 0;
				
				sum += temp;
				
			}
			else{
				
				i++;
				
			}
			
			
		}
		
	}
	
	printf("%d\n", sum);
	
	return 0;
	
}



int mystrtol(char text[], char **pEnd, int value){
	
	int value;
	int i = 0;
	char temp[32];
	
	while(isdigit(text[i])){
		
		temp[i] = text[i];
		i++;
		
	}
	
	
	temp[i] = '\0';
	
	*pEnd = &text[i];
	
	
	return atoi(temp);
	
}

Compiler output:
main.c: In function 'mystrtol':
main.c:64:13: error: 'value' redeclared as different kind of symbol
   64 |         int value;
      |             ^~~~~
main.c:62:44: note: previous definition of 'value' with type 'int'
   62 | int mystrtol(char text[], char **pEnd, int value){
      |                                        ~~~~^~~~~
main.c:81:16: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   81 |         return atoi(temp);
      |                ^~~~
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const int inf = 1000000000;
const int mod = 1000000007;
const double eps = 1e-9;
const int dx[] = { -1, 0, 1, 0};
const int dy[] = { 0, -1, 0, 1};

int main() {
	string s;
	int ans = 0;
	while (cin >> s) {
		s += ' '
		string num;
		rep(i, s.size()) {
			if ('0' <= s[i] && s[i] <= '9') num += s[i];
			else {
				ans += atoi(num.c_str());
				num.clear();
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:25: error: expected ';' before 'string'
   31 |                 s += ' '
      |                         ^
      |                         ;
   32 |                 string num;
      |                 ~~~~~~   
a.cc:34:57: error: 'num' was not declared in this scope; did you mean 'enum'?
   34 |                         if ('0' <= s[i] && s[i] <= '9') num += s[i];
      |                                                         ^~~
      |                                                         enum
a.cc:36:45: error: 'num' was not declared in this scope; did you mean 'enum'?
   36 |                                 ans += atoi(num.c_str());
      |                                             ^~~
      |                                             enum
Language: C++

a;main(n){for(;~scanf("%*[^0-9]%d",&n);)a+=n;a=!printf("%d\n",a);}

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a;main(n){for(;~scanf("%*[^0-9]%d",&n);)a+=n;a=!printf("%d\n",a);}
      | ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
    1 | a;main(n){for(;~scanf("%*[^0-9]%d",&n);)a+=n;a=!printf("%d\n",a);}
      |       ^
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
#include <numeric>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()
#define print(s) cout << (s) << endl

int main() {
    string s = "";
    int cnt = 0;
    char c;
    bool isint = false;
    bool minus = false;
    while((c = getchar() != EOF) {
        if (c >= '0' && c <= '9') {
            if (isint) {
                s += c;
                isint = true;
            }else if (!minus) {
                s = "";
                s += c;
                isint = true;
            }
        }else if (isint) {
            cnt += stoi(s);
            s = "";
            isint = false;
            if (c == '-') {
                minus = true;
            }else {
                minus = false;
            }
        }else {
            isint = false;
            if (c == '-') {
                minus = true;
            }else {
                minus = false;
            }
        }
    }
    if (s != "") {
        cnt += stoi(s);
    }
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:33: error: expected ')' before '{' token
   24 |     while((c = getchar() != EOF) {
      |          ~                      ^~
      |                                 )
Language: C++

int main()
{
        string str;
        unsigned int x, sum = 0;

        while (cin >> str) {
                for (string::size_type i = 0; i < str.length(); i++) {
                        x = 0;
                        while (isdigit(str[i])) {
                                x = 10 * x + str[i] - '0';
                                i++;
                        }
                        if (x > 0) {
                                sum += x;
                        }
                }
        }
        cout << sum << '\n';

        return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'string' was not declared in this scope
    3 |         string str;
      |         ^~~~~~
a.cc:6:16: error: 'cin' was not declared in this scope
    6 |         while (cin >> str) {
      |                ^~~
a.cc:6:23: error: 'str' was not declared in this scope; did you mean 'std'?
    6 |         while (cin >> str) {
      |                       ^~~
      |                       std
a.cc:7:22: error: 'string' is not a class, namespace, or enumeration
    7 |                 for (string::size_type i = 0; i < str.length(); i++) {
      |                      ^~~~~~
a.cc:7:47: error: 'i' was not declared in this scope
    7 |                 for (string::size_type i = 0; i < str.length(); i++) {
      |                                               ^
a.cc:9:32: error: 'isdigit' was not declared in this scope
    9 |                         while (isdigit(str[i])) {
      |                                ^~~~~~~
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << sum << '\n';
      |         ^~~~
Language: C++

using System;
using System.Linq;
public class Test
{ 
    public static void Main()
    { int ans=0;
           
        while(true){
            string str=Console.ReadLine();
            if(str==null){break;}
            string bef="";
            for(int i=0;i<str.Length;i++){
                char u=str[i];
                if(u=='0'||u=='1'||u=='2'||u=='3'||u=='4'||u=='5'||u=='6'||u=='7'||u=='8'||u=='9')
                {bef+=u;}
                else if(bef!=""){
                    ans+=int.Parse(bef);
                    bef="";
                }
                   
            }
            if(bef!=""){
            ans+=int.Parse(bef);
            bef="";
            	
            }
        }    
        Console.WriteLine(ans);
             
             
        
        // your code goes here
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Linq;
      |       ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Test
      | ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;

int main() {
  string memo;
  int num = 0;
  int temp;

  cin >> memo;

  for(int i = 0; i < memo.size(); i++) {
    if(memo[i] >= 48 && memo[i] <= 57) {
      temp = memo[i] - '0';
      temp = temp * 10;
      temp += (memo[i+j] - '0');
    }
    else {
      num += temp;
      temp = 0;
    }
  }
	
  cout << num << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: 'j' was not declared in this scope
   17 |       temp += (memo[i+j] - '0');
      |                       ^
Language: C++

bool isdigit(char c);

int main(){
  string str;
  
  while(cin >> str){
    int num = 0;
    int ans = 0;
    for(int i=0; i<str.size(); ++i){
      
      if(isdigit(str[i])){	
	if(isdigit(str[i-1])){
	  num *= 10;
	  num += (int)(str[i]-'0');
	}else if(isdigit(str[i])){
	  num += (int)(str[i]-'0');
	}
	
      }

      if(!isdigit(str[i+1])){
	ans += num;
	num = 0;
      }
      
    }
   cout << ans << endl;
  } 
  return 0;
}

bool isdigit(char c){
  switch(c){
  case '0': return true;
  case '1': return true;
  case '2': return true;
  case '3': return true;
  case '4': return true;
  case '5': return true;
  case '6': return true;
  case '7': return true;
  case '8': return true;
  case '9': return true;	    
  default : return false;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string str;
      |   ^~~~~~
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |   while(cin >> str){
      |         ^~~
a.cc:6:16: error: 'str' was not declared in this scope; did you mean 'std'?
    6 |   while(cin >> str){
      |                ^~~
      |                std
a.cc:27:4: error: 'cout' was not declared in this scope
   27 |    cout << ans << endl;
      |    ^~~~
a.cc:27:19: error: 'endl' was not declared in this scope
   27 |    cout << ans << endl;
      |                   ^~~~
Language: C++

import java.util.*;
import java.math.*;
class Main{
	public static void main(String args[]){
		Scanner s=new Scanner(System.in);
		BigInteger ret=new BigInteger("0");
		while(s.hasNext()){
			String str=s.next();
			String [] a=str.split("[^0-9]");
			for(int i=0;i<a.length;i++){
				if(a[i].length()>0)ret=ret.add(new BigInteger(a[i]));
			}
		}
		System.out.println(ret.toString());
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.math.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
    4 |         public static void main(String args[]){
      |               ^~~~~~~
      |               :
a.cc:4:33: error: 'String' has not been declared
    4 |         public static void main(String args[]){
      |                                 ^~~~~~
a.cc:16:2: error: expected ';' after class definition
   16 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:17: error: 'Scanner' was not declared in this scope
    5 |                 Scanner s=new Scanner(System.in);
      |                 ^~~~~~~
a.cc:6:17: error: 'BigInteger' was not declared in this scope
    6 |                 BigInteger ret=new BigInteger("0");
      |                 ^~~~~~~~~~
a.cc:7:23: error: 's' was not declared in this scope
    7 |                 while(s.hasNext()){
      |                       ^
a.cc:8:25: error: 'String' was not declared in this scope
    8 |                         String str=s.next();
      |                         ^~~~~~
a.cc:9:33: error: expected primary-expression before ']' token
    9 |                         String [] a=str.split("[^0-9]");
      |                                 ^
a.cc:10:39: error: 'a' was not declared in this scope
   10 |                         for(int i=0;i<a.length;i++){
      |                                       ^
a.cc:11:52: error: 'ret' was not declared in this scope
   11 |                                 if(a[i].length()>0)ret=ret.add(new BigInteger(a[i]));
      |                                                    ^~~
a.cc:11:68: error: expected type-specifier before 'BigInteger'
   11 |                                 if(a[i].length()>0)ret=ret.add(new BigInteger(a[i]));
      |                                                                    ^~~~~~~~~~
a.cc:14:17: error: 'System' was not declared in this scope
   14 |                 System.out.println(ret.toString());
      |                 ^~~~~~
a.cc:14:36: error: 'ret' was not declared in this scope
   14 |                 System.out.println(ret.toString());
      |                                    ^~~
Language: C++

#include <cctype>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main() {
	string s; cin>>s;
	int num=0;
	string tmp="";
	for (int i=0; i<s.length(); i++) {
		if (isnum(s[i])) {
			tmp += s[i];
		} else if (tmp != "") {
			num += atoi(tmp);
			tmp = "";
		}
	}
	cout << num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'isnum' was not declared in this scope; did you mean 'num'?
   11 |                 if (isnum(s[i])) {
      |                     ^~~~~
      |                     num
a.cc:14:37: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   14 |                         num += atoi(tmp);
      |                                     ^~~
      |                                     |
      |                                     std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from a.cc:2:
/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 <cctype>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main() {
	string s; cin>>s;
	int num=0;
	string tmp="";
	for (int i=0; i<s.length(); i++) {
		if (isalnum(s[i])) {
			tmp += s[i];
		} else if (tmp != "") {
			num += atoi((const char*)tmp);
			tmp = "";
		}
	}
	cout << num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:37: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'const char*'
   14 |                         num += atoi((const char*)tmp);
      |                                     ^~~~~~~~~~~~~~~~
Language: C++

include <stdio.h>
#include <string.h>
int main(){
char x[85];
int sum=0,y=0,ans=0,i,z[85];
while(scanf("%s",x)!=EOF){
for(i=0;i<strlen(x);i++){
	z[i]=x[i]-'0';
}
for(i=0;i<strlen(x);i++){
if(z[i]>=0 && z[i]<=9){
if(y==0&& z[i]>0){sum*=10;}sum+=z[i];y=0;
}else{y=1; ans+=sum; sum=0;}
}
ans+=sum;
}
printf("%d\n",ans);
return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:7: error: 'scanf' was not declared in this scope
    6 | while(scanf("%s",x)!=EOF){
      |       ^~~~~
a.cc:6:22: error: 'EOF' was not declared in this scope
    6 | while(scanf("%s",x)!=EOF){
      |                      ^~~
a.cc:3:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <string.h>
  +++ |+#include <cstdio>
    3 | int main(){
a.cc:7:11: error: 'strlen' was not declared in this scope
    7 | for(i=0;i<strlen(x);i++){
      |           ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string.h>
  +++ |+#include <cstring>
    3 | int main(){
a.cc:10:11: error: 'strlen' was not declared in this scope
   10 | for(i=0;i<strlen(x);i++){
      |           ^~~~~~
a.cc:10:11: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:17:1: error: 'printf' was not declared in this scope
   17 | printf("%d\n",ans);
      | ^~~~~~
a.cc:17:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <stdio.h>
#include <string.h>
int main(){
	char x[1000];
	while(scanf("%s",&x)!=EOF){
int sum=0,y=0,ans=0,i,z[1000];
while(scanf("%s",&x)!=EOF){
for(i=0;i<strlen(x);i++){
	z[i]=x[i]-'0';
}
for(i=0;i<strlen(x);i++){
if(z[i]>=0 && z[i]<=9){
if(y==0){sum*=10;}sum+=z[i];y=0;
}else{y=1; ans+=sum; sum=0;}
}
if(sum!=0){
	ans+=sum;}
}
printf("%d\n",ans);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main(){

	string str="", sub;
	
	while(cin>>sub, !cin.eof()){
		str+=sub;
	}
	
	str+='Z';
	
	int key=0, tmp, n=str.size();
	string s="";
	
	for(int i=0; i<n; ++i){
			
		if('0'<=str[i]&&str[i]<='9'){
			s+=str[i];
		}
		else if(s!=""){
			stringstream ss(s);
			ss>>tmp;
			key+=tmp;
			s="";
		}
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:10: error: expected '}' at end of input
   31 |         }
      |          ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

int main()
{
    size_t sum = 0;
    string s;
    while( cin >> s ) {
        for( auto it=s.cbegin(); it<s.cend(); ++it )
        {
            if ( *it >= '0' && *it <= '9' ) {
                string t;
                t += *it;
                for( it=it+1; it < s.cend() && *it >= '0' && *it <= '9'; ++it )
                    t += *(it);

                sum += atoi( t.c_str() );
            }
        }
    }
    cout << sum << endl;
}
#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

int main()
{
    size_t sum = 0;
    string s;
    while( cin >> s ) {
        for( auto it=s.cbegin(); it<s.cend(); ++it )
        {
            if ( *it >= '0' && *it <= '9' ) {
                string t;
                t += *it;
                for( it=it+1; it < s.cend() && *it >= '0' && *it <= '9'; ++it )
                    t += *(it);

                sum += atoi( t.c_str() );
            }
        }
    }
    cout << sum << endl;
}
#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

int main()
{
    size_t sum = 0;
    string s;
    while( cin >> s ) {
        for( auto it=s.cbegin(); it<s.cend(); ++it )
        {
            if ( *it >= '0' && *it <= '9' ) {
                string t;
                t += *it;
                for( it=it+1; it < s.cend() && *it >= '0' && *it <= '9'; ++it )
                    t += *(it);

                sum += atoi( t.c_str() );
            }
        }
    }
    cout << sum << endl;
}

Compiler output:
a.cc:32:5: error: redefinition of 'int main()'
   32 | int main()
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main()
      |     ^~~~
a.cc:57:5: error: redefinition of 'int main()'
   57 | int main()
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main()
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
#include <cctype>
using namespace std;

int main(int argc, const char * argv[])
{
    int snum = 0;
    int stuck = 0;
    string slit;
    while(cin >> slit){
        for (int i = 0; i < (int)slit.length(); i++) {
            if (isnumber(slit[i])) {
                stuck *= 10;
                stuck += slit[i] - '0';
            }
            if (!isnumber(slit[i + 1])) {
                snum += stuck;
                stuck = 0;
            }
        }
    }
    cout << snum << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:13:17: error: 'isnumber' was not declared in this scope
   13 |             if (isnumber(slit[i])) {
      |                 ^~~~~~~~
a.cc:17:18: error: 'isnumber' was not declared in this scope
   17 |             if (!isnumber(slit[i + 1])) {
      |                  ^~~~~~~~