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

#include<iostream>
using namespace std;

const unsigned int N = 10000000;
char s[N];
int n;

void erace(){
	for(int i=0; i<N; i++)
		if(s[i]=='\0')
			break;
		s[i] = '\0';
}

void copy(char *a){
	for(int i=0; i<N; i++){
		a[i] = s[i];
		if(s[i]=='\0')
			break;
	}
}

void solve(){
	if(n==0)
		return;
	char a[N];
	copy(a);
	erace();
	n--;
	int tmp=0,count=1;
	char temp=a[0];
	for(int i=1; a[i]!='\0'; i++){
		if(temp == a[i])
			count++;
		else{
			s[tmp] = static_cast<char>(count+48);
			for(;;tmp++){
				if(s[tmp] == '\0')
					break;
			}
			s[tmp] = temp;
			temp = a[i];
			count = 1;
			tmp++;
		}
	}
	s[tmp] = static_cast<char>(count+48);
	for(;;tmp++){
		if(s[tmp] == '\0')
			break;
	}
	s[tmp] = temp;
	solve();
}

int main(){
	while(true){
		cin >> n;
		if(!n)
			return 0;
		erace();
		cin >> s;
		solve();
		cout << s << endl;
	}
}

Compiler output:
a.cc: In function 'void erace()':
a.cc:12:19: error: 'i' was not declared in this scope
   12 |                 s[i] = '\0';
      |                   ^
Language: C++

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

int f(string);

int main()
{
	int n;
	string str;
	for(;;){
		cin>>n; if(n == 0) break;
		cin>>str;
		for(int i = 0; i < n; i++){
			string ans;
			for(int j = 0; j < str.size();){
				char buf[1024];
				int len = f(str.substr(j));
				sprintf_s(buf, "%d%c", len, str.at(j));
				ans += buf;
				j += len;
			}
			str = ans;
		}
		cout<<str<<endl;
	}
}
// sツづ個静ヲツ督ェツつゥツづァツづ個連ツ堕アツ青板づーツ陛板つキ
// sst ツづ按づァツ　return 2
int f(string s)
{
	int count;
	for(count = 1; count < s.size(); count++){
		if(s.at(count-1) != s.at(count)) break;
	}
	return count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
   20 |                                 sprintf_s(buf, "%d%c", len, str.at(j));
      |                                 ^~~~~~~~~
      |                                 sprintf
Language: C++

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

int f(string);

int main()
{
	int n;
	string str;
	for(;;){
		cin>>n; if(n == 0) break;
		cin>>str;
		for(int i = 0; i < n; i++){
			string ans;
			for(unsigned int j = 0; j < str.size();){
				char buf[1024];
				int len = f(str.substr(j));
				sprintf_s(buf, "%d%c", len, str.at(j));
				ans += buf;
				j += len;
			}
			str = ans;
		}
		cout<<str<<endl;
	}
}
// sツづ個静ヲツ督ェツつゥツづァツづ個連ツ堕アツ青板づーツ陛板つキ
// sst ツづ按づァツ　return 2
int f(string s)
{
	unsigned int count;
	for(count = 1; count < s.size(); count++){
		if(s.at(count-1) != s.at(count)) break;
	}
	return count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
   20 |                                 sprintf_s(buf, "%d%c", len, str.at(j));
      |                                 ^~~~~~~~~
      |                                 sprintf
Language: C++

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

int f(string);

int main()
{
	int n;
	string str;
	for(;;){
		cin>>n; if(n == 0) break;
		cin>>str;
		for(int i = 0; i < n; i++){
			string ans;
			for(unsigned int j = 0; j < str.size();){
				char buf[1024];
				int len = f(str.substr(j));
				sprintf_s(buf, 1024, "%d%c", len, str.at(j));
				ans += buf;
				j += len;
			}
			str = ans;
		}
		cout<<str<<endl;
	}
}
// sツづ個静ヲツ督ェツつゥツづァツづ個連ツ堕アツ青板づーツ陛板つキ
// sst ツづ按づァツ　return 2
int f(string s)
{
	unsigned int count;
	for(count = 1; count < s.size(); count++){
		if(s.at(count-1) != s.at(count)) break;
	}
	return count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
   20 |                                 sprintf_s(buf, 1024, "%d%c", len, str.at(j));
      |                                 ^~~~~~~~~
      |                                 sprintf
Language: C++

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

// sツづ個静ヲツ督ェツつゥツづァツづ個連ツ堕アツ青板づーツ陛板つキ
// sst ツづ按づァツ　return 2
int f(string s)
{
	unsigned int count;
	for(count = 1; count < s.size(); count++){
		if(s.at(count-1) != s.at(count)) break;
	}
	return count;
}

int main()
{
	int n;
	string str;
	while(1){
		cin>>n; if(n == 0) break;
		cin>>str;
		for(int i = 0; i < n; i++){
			string ans;
			for(unsigned int j = 0; j < str.size();){
				char buf[1024];
				int len = f(str.substr(j));
				sprintf_s(buf, 1024, "%d%c", len, str.at(j));
				ans += buf;
				j += len;
			}
			str = ans;
		}
		cout<<str<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:33: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
   28 |                                 sprintf_s(buf, 1024, "%d%c", len, str.at(j));
      |                                 ^~~~~~~~~
      |                                 sprintf
Language: C++

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

// sツづ個静ヲツ督ェツつゥツづァツづ個連ツ堕アツ青板づーツ陛板つキ
// sst ツづ按づァツ　return 2
int f(string s)
{
	unsigned int count;
	for(count = 1; count < s.size(); count++){
		if(s.at(count-1) != s.at(count)) break;
	}
	return count;
}

int main()
{
	int n;
	string str;
	while(1){
		cin>>n; if(n == 0) break;
		cin>>str;
		for(int i = 0; i < n; i++){
			string ans;
			for(unsigned int j = 0; j < str.size();){
				char buf[1024];
				int len = f(str.substr(j));
				sprintf_s(buf, 1024, "%d%c", len, str.at(j));
				ans += buf;	
				j += len;
			}
			str = ans;
		}
		cout<<str<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:33: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
   28 |                                 sprintf_s(buf, 1024, "%d%c", len, str.at(j));
      |                                 ^~~~~~~~~
      |                                 sprintf
Language: C++

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

// sツづ個静ヲツ督ェツつゥツづァツづ個連ツ堕アツ青板づーツ陛板つキ
// sst ツづ按づァツ　return 2
int f(string s)
{
	unsigned int count;
	for(count = 1; count < s.size(); count++){
		if(s.at(count-1) != s.at(count)) break;
	}
	return count;
}

int main()
{
	int n;
	string str;
	while(1){
		cin>>n; if(n == 0) break;
		cin>>str;
		for(int i = 0; i < n; i++){
			string ans;
			for(unsigned int j = 0; j < str.size();){
				char buf[1024];
				int len = f(str.substr(j));
				sprintf_s(buf, 1024, "%d%c", len, str.at(j));
				//ans += buf;	
				j += len;
			}
			str = ans;
		}
		cout<<str<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:33: error: 'sprintf_s' was not declared in this scope; did you mean 'sprintf'?
   28 |                                 sprintf_s(buf, 1024, "%d%c", len, str.at(j));
      |                                 ^~~~~~~~~
      |                                 sprintf
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	int n,r;
	string in,ou;
	char a,b,ra;

	while(1){
		cin >> n;

		if(n != 0){
			cin >> ou;

			for(int i = 0; i < n; i++){
				r = 1;
				in = ou;
				ou = "";
				a = in.at(0);

				for(int j = 1; j < in.length(); j++){
					b = in.at(j);
					if(a == b){
						r++;
					}else{
						ou += itoa(r, &ra, 10);
						ou += a;
						r = 1;
					}

					if(j == in.length()-1){
						ou += itoa(r, &ra, 10);
						ou += b;
						r = 1;
					}

					a = b;
				}
			}

			cout << ou << endl;
		}else{
			break;
		}
	}
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:55: error: 'itoa' was not declared in this scope
   28 |                                                 ou += itoa(r, &ra, 10);
      |                                                       ^~~~
a.cc:34:55: error: 'itoa' was not declared in this scope
   34 |                                                 ou += itoa(r, &ra, 10);
      |                                                       ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	int n,r;
	string in,ou;
	char a,b,*ra;

	ra = new char;

	while(1){
		cin >> n;

		if(n != 0){
			cin >> ou;

			for(int i = 0; i < n; i++){
				r = 1;
				in = ou;
				ou = "";
				a = in.at(0);

				for(int j = 1; j < in.length(); j++){
					b = in.at(j);
					if(a == b){
						r++;
					}else{
						ou += itoa(r, ra, 10);
						ou += a;
						r = 1;
					}

					if(j == in.length()-1){
						ou += itoa(r, ra, 10);
						ou += b;
						r = 1;
					}

					a = b;
				}
			}

			cout << ou << endl;
		}else{
			break;
		}
	}
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:55: error: 'itoa' was not declared in this scope
   30 |                                                 ou += itoa(r, ra, 10);
      |                                                       ^~~~
a.cc:36:55: error: 'itoa' was not declared in this scope
   36 |                                                 ou += itoa(r, ra, 10);
      |                                                       ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <queue>

using namespace std;

int solve()
{
  int n, l, r;
  char c;
  char buf[1000];
  string s;
  queue<char> q;
 
  cin >> n;
  while (n > 0) {
    cin >> s;
    for (int i = 0; i < s.size(); i++) q.push(s[i]);

    for (int i = 0; i < n; i++) {
      int j = 0;
      l = q.size();
      while (j < l) {
        r = 0;
        c = q.front();
        while (q.front() == c && j < l) {
          q.pop();
          r++;
          j++;
        }
        sprintf(buf, "%d", r);
        for (int k = 0; k < strlen(buf); k++) q.push(buf[k]);
        q.push(c);
      }
    }
    while (q.size() > 0) {
      cout << q.front();
      q.pop();
    }
    cout << endl;
    cin >> n;
  }
}

int main()
{
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:33:29: error: 'strlen' was not declared in this scope
   33 |         for (int k = 0; k < strlen(buf); k++) q.push(buf[k]);
      |                             ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <queue>
  +++ |+#include <cstring>
    5 | 
a.cc:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
   44 | }
      | ^
Language: C++

#define _USE_MATH_DEFINES
#define INF 100000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair <int,int> P;

static const double eps = 1e-8;

int main(){
	int n;
	while(~scanf("%d",&n)){
		if(n==0) break;
		string num;
		cin >> num;
		for(int i=0;i<n;i++){
			string next;
			for(int j=0;j<num.size();){
				int c = 0;
				char alph;
				for(int k=0;k<=9;k++){					
					for(int len=1;j+len-1<num.size();len++){
						string tmp = num.substr(j,len);
						if(count(tmp.begin(),tmp.end(),'0'+k) == len){
							c++;
							alph = '0' + k;
						}
					}
				}

				j+=c;
				
				char buf[32];
				itoa(c,buf,10);
				string tmp = buf;
				next.append(tmp);
				next.push_back(alph);
			}
			num = next;
		}

		cout << num << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:33: error: 'itoa' was not declared in this scope
   49 |                                 itoa(c,buf,10);
      |                                 ^~~~
Language: C++

#define _USE_MATH_DEFINES
#define INF 100000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair <int,int> P;

static const double eps = 1e-8;

int main(){
	int n;
	while(~scanf("%d",&n)){
		if(n==0) break;
		string num;
		cin >> num;
		for(int i=0;i<n;i++){
			string next;
			for(int j=0;j<num.size();){
				int c = 0;
				char alph;
				for(int k=0;k<=9;k++){					
					for(int len=1;j+len-1<num.size();len++){
						string tmp = num.substr(j,len);
						if(count(tmp.begin(),tmp.end(),'0'+k) == len){
							c++;
							alph = '0' + k;
						}
					}
				}

				j+=c;
				
				char buf[32];
				itoa(c,buf,10);
				string tmp = buf;
				next.append(tmp);
				next.push_back(alph);
			}
			num = next;
		}

		cout << num << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:33: error: 'itoa' was not declared in this scope
   50 |                                 itoa(c,buf,10);
      |                                 ^~~~
Language: C++

#include <iostream>
#include <sstream>
#include <cstdlib>
using namespace std;

void addstr(string s,int a,int b) {
  stringstream ss;
  ss << a << b;
  s += ss.str();
}

int main() {
  int n,count = 1,p = 0;
  string str;
  int r[10000],a[10000],x[10000];
  int size;

  while(cin >> n) {
    if(n == 0) break;
    cin >> str;
    for(int i=0;i<n;i++) {
      size = str.size();
      x[0] = atoi(str.substr(0,1).c_str());
      for(int k=1;k<size;k++) {
        x[k] = atoi(str.substr(k,1).c_str());
        if(x[k] == x[k-1]) {
          count++;
          if(k == size-1) {
            r = count;
            a = x[k-1];

            addstr(newstr,r,a);
            str = newstr;
          }
        }
        else {
          //    cout << count << x[k-1];
          r = count;
          a = x[k-1];
          addstr(newstr,r,a);
          if(k == size-1) {
            r = 1;
            a = x[k];
            addstr(newstr,r,a);
            str = newstr;
          }
          count = 1;
        }
      }
      count = 1;
    }
    cout << str << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:15: error: incompatible types in assignment of 'int' to 'int [10000]'
   29 |             r = count;
      |             ~~^~~~~~~
a.cc:30:15: error: incompatible types in assignment of 'int' to 'int [10000]'
   30 |             a = x[k-1];
      |             ~~^~~~~~~~
a.cc:32:20: error: 'newstr' was not declared in this scope
   32 |             addstr(newstr,r,a);
      |                    ^~~~~~
a.cc:38:13: error: incompatible types in assignment of 'int' to 'int [10000]'
   38 |           r = count;
      |           ~~^~~~~~~
a.cc:39:13: error: incompatible types in assignment of 'int' to 'int [10000]'
   39 |           a = x[k-1];
      |           ~~^~~~~~~~
a.cc:40:18: error: 'newstr' was not declared in this scope
   40 |           addstr(newstr,r,a);
      |                  ^~~~~~
a.cc:42:15: error: incompatible types in assignment of 'int' to 'int [10000]'
   42 |             r = 1;
      |             ~~^~~
a.cc:43:15: error: incompatible types in assignment of 'int' to 'int [10000]'
   43 |             a = x[k];
      |             ~~^~~~~~
Language: C++

#include <iostream>
#include <iterator>
#include <fstream>
#include <sstream>
#include <strstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime>

using namespace std;

int main(void){
	string str;
	string str2;
	string str3;
	int a,b,c,n,nn;
	char sum[10];
	while(1){
		cin >> n;
		if(n==0)break;
		cin >> str;
		for(a=0;a<n;a++){
			nn=1;
			for(b=1;b<str.size();b++){
				if(b==str.size()-1){
					if(str[b-1]==str[b]){
						nn++;
						itoa(nn,sum,10);
						str2+=sum;
						back_inserter(str2)=str[b-1];
						for(c=0;c<10;c++)sum[c]='\0';
					}else{
						itoa(nn,sum,10);
						str2+=sum;
						back_inserter(str2)=str[b-1];
						back_inserter(str2)='1';
						back_inserter(str2)=str[b];
						for(c=0;c<10;c++)sum[c]='\0';
					}
				}else{
					if(str[b-1]==str[b]){
						nn++;
					}else{
						itoa(nn,sum,10);
						str2+=sum;
						back_inserter(str2)=str[b-1];
						nn=1;
						for(c=0;c<10;c++)sum[c]='\0';
					}
				}
			}
			str=str2;
			str2="";
		}
		cout << str << endl;
	}
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/backward/strstream:50,
                 from a.cc:5:
/usr/include/c++/14/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
   32 | #warning \
      |  ^~~~~~~
a.cc: In function 'int main()':
a.cc:47:49: error: 'itoa' was not declared in this scope
   47 |                                                 itoa(nn,sum,10);
      |                                                 ^~~~
a.cc:52:49: error: 'itoa' was not declared in this scope
   52 |                                                 itoa(nn,sum,10);
      |                                                 ^~~~
a.cc:63:49: error: 'itoa' was not declared in this scope
   63 |                                                 itoa(nn,sum,10);
      |                                                 ^~~~
Language: C++

#include <iostream>
#include <iterator>
#include <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime>
#include <stdlib.h>

using namespace std;

int main(void){
	string str;
	string str2;
	string str3;
	int a,b,c,n,nn;
	char sum[10];
	while(1){
		cin >> n;
		if(n==0)break;
		cin >> str;
		for(a=0;a<n;a++){
			nn=1;
			for(b=1;b<str.size();b++){
				if(b==str.size()-1){
					if(str[b-1]==str[b]){
						nn++;
						itoa(nn,sum,10);
						str2+=sum;
						back_inserter(str2)=str[b-1];
						for(c=0;c<10;c++)sum[c]='\0';
					}else{
						itoa(nn,sum,10);
						str2+=sum;
						back_inserter(str2)=str[b-1];
						back_inserter(str2)='1';
						back_inserter(str2)=str[b];
						for(c=0;c<10;c++)sum[c]='\0';
					}
				}else{
					if(str[b-1]==str[b]){
						nn++;
					}else{
						itoa(nn,sum,10);
						str2+=sum;
						back_inserter(str2)=str[b-1];
						nn=1;
						for(c=0;c<10;c++)sum[c]='\0';
					}
				}
			}
			str=str2;
			str2="";
		}
		cout << str << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:49: error: 'itoa' was not declared in this scope
   47 |                                                 itoa(nn,sum,10);
      |                                                 ^~~~
a.cc:52:49: error: 'itoa' was not declared in this scope
   52 |                                                 itoa(nn,sum,10);
      |                                                 ^~~~
a.cc:63:49: error: 'itoa' was not declared in this scope
   63 |                                                 itoa(nn,sum,10);
      |                                                 ^~~~
Language: C++

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

int main(void)
{
	int N;



	while(cin >> N,N){

	string str;
	cin >> str;

	char c;
	int co;
	while(N > 0){
		N--;
		string t;
		co = 1;
		c = str[0];
		for(int i = 1; i < str.size(); i++){
			if(str[i] == c)
				co++;
			else{
				char s[10];
				itoa(co, s, 10);
				t += s;
				t.push_back(c);

				c = str[i];
				co = 1;
			}
		}
				char s[10];
				itoa(co, s, 10);
				t += s;
				t.push_back(c);




		str = t;

	}

	cout << str.c_str() << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:33: error: 'itoa' was not declared in this scope
   29 |                                 itoa(co, s, 10);
      |                                 ^~~~
a.cc:38:33: error: 'itoa' was not declared in this scope
   38 |                                 itoa(co, s, 10);
      |                                 ^~~~
Language: C++

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

int main(void)
{
	int N;



	while(cin >> N,N){

	string str;
	cin >> str;

	char c;
	int co;
	while(N > 0){
		N--;
		string t;
		co = 1;
		c = str[0];
		for(int i = 1; i < str.size(); i++){
			if(str[i] == c)
				co++;
			else{
				char s[10];
				itoa(co, s, 10);
				t += s;
				t.push_back(c);

				c = str[i];
				co = 1;
			}
		}
				char s[10];
				itoa(co, s, 10);
				t += s;
				t.push_back(c);




		str = t;

	}

	cout << str.c_str() << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:33: error: 'itoa' was not declared in this scope
   30 |                                 itoa(co, s, 10);
      |                                 ^~~~
a.cc:39:33: error: 'itoa' was not declared in this scope
   39 |                                 itoa(co, s, 10);
      |                                 ^~~~
Language: C++

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

int main(void)
{
	int N;



	while(cin >> N,N){

	string str;
	cin >> str;

	char c;
	int co;
	while(N > 0){
		N--;
		string t;
		co = 1;
		c = str[0];
		for(int i = 1; i < str.size(); i++){
			if(str[i] == c)
				co++;
			else{
				char s[10];
				itoa(co, s, 10);
				t += s;
				t.push_back(c);

				c = str[i];
				co = 1;
			}
		}
				char s[10];
				itoa(co, s, 10);
				t += s;
				t.push_back(c);




		str = t;

	}

	cout << str.c_str() << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:33: error: 'itoa' was not declared in this scope
   30 |                                 itoa(co, s, 10);
      |                                 ^~~~
a.cc:39:33: error: 'itoa' was not declared in this scope
   39 |                                 itoa(co, s, 10);
      |                                 ^~~~
Language: C++

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

int main(void)
{
	int N;



	while(cin >> N,N){

	string str;
	cin >> str;

	char c;
	int co;
	while(N > 0){
		N--;
		string t;
		co = 1;
		c = str[0];
		for(int i = 1; i < str.size(); i++){
			if(str[i] == c)
				co++;
			else{
				char s[10];
				sprintf(s, "%d", co);
				t += s;
				t.push_back(c);

				c = str[i];
				co = 1;
			}
		}
				char s[10];
				itoa(co, s, 10);
				t += s;
				t.push_back(c);




		str = t;

	}

	cout << str.c_str() << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:33: error: 'itoa' was not declared in this scope
   39 |                                 itoa(co, s, 10);
      |                                 ^~~~
Language: C++

char a[999999],b[999999],*p;
main(i,n,c,s,d,l){
  for(;scanf("%d",&n),n;printf("%s\n",a)){
    scanf("%s",a);
    for(;n;n--){
      for(p=b,i=d=s=0,l=strlen(a);i<=l;i++){
        c=a[i];
        if(!s)s=c;
        if(s!=c){
          p+=sprintf(p,"%d",d);
          *(p++)=s;
          d=0;s=c;
        }
        d++;
      }
      *p=0;
      strcpy(a,b);
    }
  }
  return 0;
}

Compiler output:
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 | main(i,n,c,s,d,l){
      |     ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

string ToString ( int x )
{
	string s = "";
	
	while ( x )
	{
		s += ((x % 10) + '0');
		x /= 10;
	}

	reverse(s.begin(), s.end());

	return s;
}

int main ( void )
{
	int n;

	while ( cin >> n, n )
	{
		string s1, s2;
		cin >> s1;

		for (int i = 0; i < n; ++i)
		{
			char c = s1[0];
			int counter = 0;

			s1 += 'x';
			s2 = "";

			for (int j = 0; j < s1.size(); ++j)
			{
				if ( c != s1[j] )
				{
					// cout << ToString(counter) << ' ' << c << endl;
					s2 += ToString(counter) + c;
					c = s1[j];
					counter = 1;
				}
				else
					++counter;
			}
			s1 = s2;
		}

		cout << s1 << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'std::string ToString(int)':
a.cc:16:9: error: 'reverse' was not declared in this scope
   16 |         reverse(s.begin(), s.end());
      |         ^~~~~~~
Language: C++

#include <cstdio>
#include <cstring>
using namespace std;
int main(){
int a,i,j,b,sum=1,num=0;
char x[21][101];
  scanf("%d",&a);
  if(a==0) break;
    scanf("%s",&x[0]);
      for(i=0;i<a;i++){
         for(j=0;j<strlen(x[i]);j++){
             if(x[i][j]==x[i][j+1]){
               sum++;
             }else{
               if(sum>=10){
                 x[i+1][num]=sum/10+'0';
                 x[i+1][num+1]=sum%10+'0';
                 x[i+1][num+2]=x[i][j];
                 num+=3; sum=1;
               }else{
                 x[i+1][num]=sum+'0';
                 x[i+1][num+1]=x[i][j];
                 num+=2; sum=1;
               }}
             }
           if(sum>=10){
                 x[i+1][num]=sum/10+'0';
                 x[i+1][num+1]=sum%10+'0';
                 x[i+1][num+2]=x[i][j];
                 num+=3;sum=1;
               }else{
                 x[i+1][num]=sum+'0';
                 x[i+1][num+1]=x[i][j];
                 num+=2;  sum=1;
               }
             }
           printf("%s\n",x[a]);
         
         return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: break statement not within loop or switch
    8 |   if(a==0) break;
      |            ^~~~~
Language: C++


#include <cstdio>
#include <cstring>
using namespace std;
int main(){
while(1){
int a,i,j,b,sum=1,num=0;
char x[21][101];
  scanf("%d",&a);
  if(a==0) break;
    scanf("%s",&x[0]);
      for(i=0;i<a;i++){
         for(j=0;j<strlen(x[i]);j++){
             if(x[i][j]==x[i][j+1]){
               sum++;
             }else{
               if(sum>=10){
                 x[i+1][num]=sum/10+'0';
                 x[i+1][num+1]=sum%10+'0';
                 x[i+1][num+2]=x[i][j];
                 num+=3; sum=1;
               }else{
                 x[i+1][num]=sum+'0';
                 x[i+1][num+1]=x[i][j];
                 num+=2; sum=1;
               }}
             }
           if(sum>=10){
                 x[i+1][num]=sum/10+'0';
                 x[i+1][num+1]=sum%10+'0';
                 x[i+1][num+2]=x[i][j];
                 num+=3;sum=1;
               }else{
                 x[i+1][num]=sum+'0';
                 x[i+1][num+1]=x[i][j];
                 num+=2;  sum=1;
               }
             }
           for(i=0;i<num;i++){
           printf("%c",x[a][i]);
           }
print("\n");
         }
         return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:1: error: 'print' was not declared in this scope; did you mean 'printf'?
   42 | print("\n");
      | ^~~~~
      | printf
Language: C++

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

using namespace std;

int main()
{
	char in[2][101],key,temp[101];
	int n,now,cnt,wrt;
	bool turn;

	while(cin >> n && n){
		cin >> in[0];
		turn = 1;
		for(int i = 0; i < n; i++){
			turn = !turn;
			now = 0;
			wrt = 0;
			while(now < strlen(in[turn])){
				key = in[turn][now];
				cnt = 0;
				while(now < strlen(in[turn]) && key == in[turn][now]){
					now++;
					cnt++;
				}
				sprintf(temp,"%d",cnt);
				for(int j = 0; j < strlen(temp); j++){
					in[!turn][wrt] = temp[j];
					wrt++;
				}
				in[!turn][wrt] = key;
				wrt++;
			}
			in[!turn][wrt] = '\0';
		}
		cout << in[!turn] << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:37: error: 'strlen' was not declared in this scope
   20 |                         while(now < strlen(in[turn])){
      |                                     ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include<cstdio>
#include<string>;

using namespace std;

int n;
int str_n;
char str[10000];
char str_[10000];

void solve()
{
	char c=str[0];
	int n=1;
	int k=0;
		str_n=strlen(str);
		for(int i=1;i<str_n+1;i++)
		{
			if(c==str[i]&&i!=str_n)
			{
				n++;
			}
			else 
			{
				if(n>=10)
				{
					str_[k+1]=n%10+'0';
					str_[k]=(n-n%10)/10+'0';
					k+=2;
				}
				else
				{
					str_[k]=n+'0';
					k++;
				}
				str_[k]=c;
				k++;
				c=str[i];
				n=1;
			}
		}
		strcpy(str,str_);
		fill(str_,str_+100,0);
}

int main()
{
	while(scanf("%d",&n)!=EOF)
	{
		fill(str_,str_+100,0);
		fill(str,str+100,0);
		if(n==0)break;
		getchar();
		gets(str);
		for(int i=0;i<n;i++)
		{
			solve();
		}
		printf("%s\n",str);
	}
	return true;
}

Compiler output:
a.cc:2:17: warning: extra tokens at end of #include directive
    2 | #include<string>;
      |                 ^
a.cc: In function 'void solve()':
a.cc:16:23: error: 'strlen' was not declared in this scope
   16 |                 str_n=strlen(str);
      |                       ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<string>;
  +++ |+#include <cstring>
    3 | 
a.cc:42:17: error: 'strcpy' was not declared in this scope
   42 |                 strcpy(str,str_);
      |                 ^~~~~~
a.cc:42:17: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int main()':
a.cc:54:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   54 |                 gets(str);
      |                 ^~~~
      |                 getw
Language: C++

#include<cstdio>
#include<string>

using namespace std;

int n;
int str_n;
char str[10000];
char str_[10000];

void solve()
{
	char c=str[0];
	int n=1;
	int k=0;
		str_n=strlen(str);
		for(int i=1;i<str_n+1;i++)
		{
			if(c==str[i]&&i!=str_n)
			{
				n++;
			}
			else 
			{
				if(n>=10)
				{
					str_[k+1]=n%10+'0';
					str_[k]=(n-n%10)/10+'0';
					k+=2;
				}
				else
				{
					str_[k]=n+'0';
					k++;
				}
				str_[k]=c;
				k++;
				c=str[i];
				n=1;
			}
		}
		strcpy(str,str_);
		fill(str_,str_+100,0);
}

int main()
{
	while(scanf("%d",&n)!=EOF)
	{
		fill(str_,str_+100,0);
		fill(str,str+100,0);
		if(n==0)break;
		getchar();
		gets(str);
		for(int i=0;i<n;i++)
		{
			solve();
		}
		printf("%s\n",str);
	}
	return true;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:16:23: error: 'strlen' was not declared in this scope
   16 |                 str_n=strlen(str);
      |                       ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<string>
  +++ |+#include <cstring>
    3 | 
a.cc:42:17: error: 'strcpy' was not declared in this scope
   42 |                 strcpy(str,str_);
      |                 ^~~~~~
a.cc:42:17: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int main()':
a.cc:54:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   54 |                 gets(str);
      |                 ^~~~
      |                 getw
Language: C++

#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
using namespace std;
int main(){
	int n;
	while(scanf("%d",&n) && n){
		string a;
		cin >> a;
		for(int i=0;i<n;i++){
			string b;
			int ro=1;
			for(int i=1;i<a.size();i++){
				if(a[i-1]==a[i]){
					ro++;
				}else{
					string ru;
					while(ro){
						int r=ro%10;
						ru.push_back(r+'0');
						ro/=10;
					}
					ro=1;
					reverse(ru.begin(),ru.end());
					b+=ru;
					b.push_back(a[i-1]);
				}
			}
					string ru;
					while(ro){
						int r=ro%10;
						ru.push_back(r+'0');
						ro/=10;
					}
					ro=1;
					reverse(ru.begin(),ru.end());
					b+=ru;
					b.push_back(a[a.size()-1]);
					a=b;
		}
		cout << a << endl;
	}
}

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

#include <iostream>

using namespace std;

int main(void){
	int	n;
	char	str[100],tmp[100];

	cin >> n >> str;
	for(int i=0;str[i];i++)
		str[i]-=0x30;

	for(int i=0;i<n;i++){
		int p=0;
		for(int j=0;str[j];j++){
			int c = 1;
			while(str[j]==str[j+1]){
				j++;
				c++;
			}

			tmp[p++]=c;
			tmp[p++]=str[j];			
		}
		tmp[p]='\0';
		strcpy(str,tmp);
	}
	for(int i=0;str[i];i++)
		str[i]+=0x30;
	cout << str << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'strcpy' was not declared in this scope
   26 |                 strcpy(str,tmp);
      |                 ^~~~~~
a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

def foo(n):
    ret = ""
    cnt = 1
    for i in range(1, len(n)):
        if n[i - 1] == n[i]:
            cnt += 1
            continue
        else:
            ret += str(cnt) + n[i - 1]
            cnt = 1

    ret += str(cnt) + n[-1]

    return ret


while 1:
    n = input()
    if n == 0:
        break
    m = raw_input().strip()
    for i in range(n):
        m = foo(m)
    print m

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def foo(n):
      | ^~~
Language: C++

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

using namespace std;
int N;
string S;


string::iterator CountSeqStr(string::iterator start, string *s, int *n){
  *s = *start;
  *n = 0;
  string tmp;
  for(;tmp = *start, tmp == *s && start != S.end(); ++start){
    (*n)++;
  }
  return --start;
}

string F(){
  string retS;
  string s;
  string::iterator it;
  int n;
  for(it= S.begin(); it != S.end(); ++it){
    it = CountSeqStr(it, &s, &n);
    char *strn;
    retS.append(string(itoa(n, strn, 10)));
    retS.append(s);
  }
  return retS;
}


int main(){
  while(cin >> N && N){
    cin >> S;
    for(int i=0; i<N; i++){
      string tmp;
      S = F();
    }
    cout << S << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'std::string F()':
a.cc:29:24: error: 'itoa' was not declared in this scope; did you mean 'it'?
   29 |     retS.append(string(itoa(n, strn, 10)));
      |                        ^~~~
      |                        it
Language: C++

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <stdlib.h>

using namespace std;
int N;
string S;


string::iterator CountSeqStr(string::iterator start, string *s, int *n){
  *s = *start;
  *n = 0;
  string tmp;
  for(;tmp = *start, tmp == *s && start != S.end(); ++start){
    (*n)++;
  }
  return --start;
}

string F(){
  string retS;
  string s;
  string::iterator it;
  int n;
  for(it= S.begin(); it != S.end(); ++it){
    it = CountSeqStr(it, &s, &n);
    char *strn;
    retS.append(string(itoa(n, strn, 10)));
    retS.append(s);
  }
  return retS;
}


int main(){
  while(cin >> N && N){
    cin >> S;
    for(int i=0; i<N; i++){
      string tmp;
      S = F();
    }
    cout << S << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'std::string F()':
a.cc:30:24: error: 'itoa' was not declared in this scope; did you mean 'it'?
   30 |     retS.append(string(itoa(n, strn, 10)));
      |                        ^~~~
      |                        it
Language: Java

public class Main {
	static final Scanner scan = new Scanner(System.in);
	public static void main(String[] args) {
		int n = scan.nextInt();
		while(n!=0){
			int[] l = new int[n];
			routine(n,-1, 0, l);
			n = scan.nextInt();
		}
	}
	
	private static void routine(int n, int m, int depth, int[] l){
		if(n==0){
			for(int j=0; j<depth; j++)
				System.out.print(l[j]+" ");
			System.out.println();
			return;
		}else{
			for(int i=n; i>0; i--){
				if(i>m && m!=-1)	continue;
				l[depth] = i;
				routine(n-i, i, depth+1, l);
			}
		}
	}

}

Compiler output:
Main.java:2: error: cannot find symbol
	static final Scanner scan = new Scanner(System.in);
	             ^
  symbol:   class Scanner
  location: class Main
Main.java:2: error: cannot find symbol
	static final Scanner scan = new Scanner(System.in);
	                                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {
	int[] a;
	public static void main(String []args){
		
		try{
			FileWriter fw = new FileWriter("output.txt");
			BufferedWriter bw = new BufferedWriter(fw);

		while (true) {
			 Scanner in = new Scanner(System.in);
			 int num = in.nextInt();
			 if(num==0)
				 break;
			 int[] a=new int[num];
			 int p=0;
			 int t=0;
			 int pre=0;
			 a[0]=num;
			 for(;;){
				 for (int i=0;i<num-1;i++) {
					 //------出力------------
					 
					 if(a[0]==pre){
						 int h=lch(a,0,1);
						 int q=h;
						 for(int j=0;j<h;j++){
							 a[j]--;
							 if(a[q]==a[0])
								 q++;
							 a[q]++;
						 }
						 p=0;
						 t=0;
					 }
					 if(p==0 && pre!=a[0]){
					 for(int j=0;j<num;j++){
						 p=1;
						if(a[j]!=0)
							bw.write(""+a[j]+" ");
						else{
							bw.write("\n");
							if(a[num-a[0]]==1){
								pre=a[0];
								int h=1;
								for(int k=2;k<num;k++){
									a[h]=a[h]+a[k];
									a[k]=0;
									if(a[h]==a[0])
										h++;
								}
								t=1;
							}
							break;
						}
					 }
					 }
					 //----------------------
					 if(((a[i+1]+1)<=(a[i]-1) && a[i+1]<=1) || (t==1 && (a[i+1]+1)<=(a[i]-1))){
						 a[i]--;
						 a[i+1]++;
						 i=-1;
						 t=0;
						 p=0;
					 }else if(t==1){
				 	}else if(a[i+1]<=1 && a[i]>=2){
						 a[rch(a,i,i+1)]++;
						 a[i]--;
						 i=-1;
						 p=0;
					 }else if(a[i+1]<=1){
						 break;
					 }
				 }
				 if(a[num-1]==1)
					 bw.write("\n");
					 break;
			}
			 for (int i = 0; i < a.length; i++) {
				a[i]=0;
			}
		}
		bw.close();
		}catch(IOException e){
			System.out.println(e);
		}
	}
	
	public static int rch(int[] a,int x,int y){
		if((a[x]-1)==a[y])
			return rch(a,x,y+1);
		else
			return y;		
	}
	public static int lch(int[] a,int x,int y){
		if(a[x]==a[y])
			return lch(a,x,y+1);
		else
			return y;		
	}
}

Compiler output:
Main.java:6: error: cannot find symbol
			FileWriter fw = new FileWriter("output.txt");
			^
  symbol:   class FileWriter
  location: class Main
Main.java:6: error: cannot find symbol
			FileWriter fw = new FileWriter("output.txt");
			                    ^
  symbol:   class FileWriter
  location: class Main
Main.java:7: error: cannot find symbol
			BufferedWriter bw = new BufferedWriter(fw);
			^
  symbol:   class BufferedWriter
  location: class Main
Main.java:7: error: cannot find symbol
			BufferedWriter bw = new BufferedWriter(fw);
			                        ^
  symbol:   class BufferedWriter
  location: class Main
Main.java:10: error: cannot find symbol
			 Scanner in = new Scanner(System.in);
			 ^
  symbol:   class Scanner
  location: class Main
Main.java:10: error: cannot find symbol
			 Scanner in = new Scanner(System.in);
			                  ^
  symbol:   class Scanner
  location: class Main
Main.java:83: error: cannot find symbol
		}catch(IOException e){
		       ^
  symbol:   class IOException
  location: class Main
7 errors
Language: C

#include <stdio.h>
#include <memory.h>
void f(int now,int rest,int list[],int p){
int i;
list[p]=now;
if(rest==0){
for(i=0;i<=p;i++){
if(i>0){
printf(" ");
}
printf("%d",list[i]);
}
for(i=rest;i>0;i--){
f(i,rest-i,list,p+1);
}
}
int main(void){
int n,i,list[301];
while(1){
scanf("%d",&n);
if(n==0){
break;
}
memset(list,0,sizeof(list));
for(i=n;i>0;i--){
f(i,n-i,list,0);
}
}
return 0;
}

Compiler output:
main.c: In function 'f':
main.c:30:1: error: expected declaration or statement at end of input
   30 | }
      | ^
Language: C

int block[31];
void recur(int t, int b)
{
	if (b == 0)
	{
		int i;
		for (i = 0; block[i + 1]; ++i)
			printf("%d ", block[i]);
		printf("%d\n", block[i]);
		return;
	}

	for (int i = min(b, t ? block[t - 1] : 99); i > 0; --i)
	{
		block[t] = i;
		recur(t + 1, b - i);
		block[t] = 0;
	}
}
int main()
{
	int n;
	while (scanf("%d", &n), n)
	{
		recur(0, n);
	}
}

Compiler output:
main.c: In function 'recur':
main.c:8:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |                         printf("%d ", block[i]);
      |                         ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | int block[31];
main.c:8:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    8 |                         printf("%d ", block[i]);
      |                         ^~~~~~
main.c:8:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:9:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    9 |                 printf("%d\n", block[i]);
      |                 ^~~~~~
main.c:9:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:22: error: implicit declaration of function 'min' [-Wimplicit-function-declaration]
   13 |         for (int i = min(b, t ? block[t - 1] : 99); i > 0; --i)
      |                      ^~~
main.c: In function 'main':
main.c:23:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   23 |         while (scanf("%d", &n), n)
      |                ^~~~~
main.c:23:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:23:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:23:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
Language: C

int block[31], i;
void recur(int t, int b)
{
	if (b == 0)
	{
		int i;
		for (i = 0; block[i + 1]; ++i)
			printf("%d ", block[i]);
		printf("%d\n", block[i]);
		return;
	}

	for (i = min(b, t ? block[t - 1] : 99); i > 0; --i)
	{
		block[t] = i;
		recur(t + 1, b - i);
		block[t] = 0;
	}
}
int main()
{
	int n;
	while (scanf("%d", &n), n)
	{
		recur(0, n);
	}
}

Compiler output:
main.c: In function 'recur':
main.c:8:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |                         printf("%d ", block[i]);
      |                         ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | int block[31], i;
main.c:8:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    8 |                         printf("%d ", block[i]);
      |                         ^~~~~~
main.c:8:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:9:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    9 |                 printf("%d\n", block[i]);
      |                 ^~~~~~
main.c:9:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:18: error: implicit declaration of function 'min' [-Wimplicit-function-declaration]
   13 |         for (i = min(b, t ? block[t - 1] : 99); i > 0; --i)
      |                  ^~~
main.c: In function 'main':
main.c:23:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   23 |         while (scanf("%d", &n), n)
      |                ^~~~~
main.c:23:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:23:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:23:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
Language: C

#include <cstdio>
#include <algorithm>
int block[31];
void recur(int t, int b)
{
	if (b == 0)
	{
		int i;
		for (i = 0; block[i + 1]; ++i)
			printf("%d ", block[i]);
		printf("%d\n", block[i]);
		return;
	}

	for (int i = min(b, t ? block[t - 1] : 99); i > 0; --i)
	{
		block[t] = i;
		recur(t + 1, b - i);
		block[t] = 0;
	}
}
int main()
{
	int n;
	while (scanf("%d", &n), n)
	{
		recur(0, n);
	}
}

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

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

void reset(int a[]){
    rep(i,50){
        a[i]=0;
    }
}
void show(FILE *fp,int array[]){
    int temp=0;
    while(array[temp+1]!=0){
        fprintf(outf,"%d ",array[temp]);
        temp++;
    }
    fprintf(outf,"%d\n",array[temp]);
}

void dfs(FILE *fp,int *a){
    show(fp,a);
    if(a[1]==0||a[1]==1)
        return;
    int last = 0;
    for(last = 0;a[last+1]!=0;last++);
    if(a[last]!=1){
        a[last]--;
        a[++last]++;
        dfs(fp,a);
    }else{
        for(int temp = last-1;temp >= 1;temp--){
            if(a[temp]==2){
                a[temp]=1;
                a[++last]++;
                dfs(fp,a);
                break;
            }else if(a[temp]>=3){
                a[temp]--;
                a[temp+1]++;
                dfs(fp,a);
                break;
            }
        }
    }
    return;
}

int main() {
    FILE *inf;
    FILE *outf;
    if((inf=fopen("input.txt","r"))==NULL){
        printf("error");return 0;}
    if((outf=fopen("output.txt","w"))==NULL){
        printf("oui");fclose(inf);return 0;}
    int n;
    int array[50];
    while(fscanf(inf,"%d",&n),n!=0){
    for(int now = n;now > 0;now--){
        
        reset(array);
        int temp = n;
        int last = 0;
        while(temp > now){
            array[last]=now;
            last++;
            temp -= now;
        }
        array[last]=temp;
        dfs(outf,array);
    }}
    fclose(inf);
    fclose(outf);
    return 2;
}

Compiler output:
a.cc: In function 'void show(FILE*, int*)':
a.cc:15:17: error: 'outf' was not declared in this scope
   15 |         fprintf(outf,"%d ",array[temp]);
      |                 ^~~~
a.cc:18:13: error: 'outf' was not declared in this scope
   18 |     fprintf(outf,"%d\n",array[temp]);
      |             ^~~~
Language: C++

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

void reset(int a[]){
    rep(i,100){
        a[i]=0;
    }
}
void show(int array[]){
    int temp=0;
    while(array[temp+1]!=0||last<50){
        printf("%d ",array[temp]);
        temp++;
    }
    printf("%d\n",array[temp]);
}

void dfs(int *a){
    show(a);
    if(a[1]==0||a[1]==1)
        return;
    int last = 0;
    for(last = 0;a[last+1]!=0||last<50;last++);
    if(a[last]!=1){
        a[last]--;
        a[++last]++;
        dfs(a);
    }else{
        for(int temp = last-1;temp >= 1;temp--){
            if(a[temp]==2){
                a[temp]=1;
                a[++last]++;
                dfs(a);
                break;
            }else if(a[temp]>=3){
                a[temp]--;
                a[temp+1]++;
                dfs(a);
                break;
            }
        }
    }
    return;
}

int main() {
    int n;
    int array[100];
    while(scanf("%d",&n),n!=0){
    for(int now = n;now > 0;now--){
        
        reset(array);
        int temp = n;
        int last = 0;
        while(temp > now){
            array[last]=now;
            last++;
            temp -= now;
        }
        array[last]=temp;
        dfs(array);
    }}
    return 2;
}

Compiler output:
a.cc: In function 'void show(int*)':
a.cc:14:29: error: 'last' was not declared in this scope
   14 |     while(array[temp+1]!=0||last<50){
      |                             ^~~~