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

#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
int main(){
int n;
int m;
int b;
int c;
int d;
while(cin >>n){
cin >>m;
if(n==0){break;}
int a[m];
b=0;
while(b<m){
a[b]=0;
b=b+1;}
b=0;
while(b<n){
c=0;
while(c<m){
cin >>d;
if(d==1){a[c]=a[c]+1;}
c=c+1;}
b=b+1;}
stable_sort(a.begin(),a.end(),greater<int>() );
b=0;
while(b<m){
cout <<a[b];
if(b==m-1){cout <<endl;}
else{cout <<" "}
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:15: error: request for member 'begin' in 'a', which is of non-class type 'int [m]'
   27 | stable_sort(a.begin(),a.end(),greater<int>() );
      |               ^~~~~
a.cc:27:25: error: request for member 'end' in 'a', which is of non-class type 'int [m]'
   27 | stable_sort(a.begin(),a.end(),greater<int>() );
      |                         ^~~
a.cc:32:16: error: expected ';' before '}' token
   32 | else{cout <<" "}
      |                ^
      |                ;
Language: C++

#include <stdio.h>

int hyou[100];

void main()
{
	int m,n;
	int zyuni[100];

	FILE *fo,*fc;
	fo = fopen("input.txt","r");
	fc = fopen("output.txt","w");

	
	fscanf(fo,"%d %d",&m,&n);
	for(int i=0; i<m; i++){
		for(int j=1; j<=n; j++){
			int kari;
			fscanf(fo,"%d",&kari);
			hyou[j] += kari;
		}
	}

	for(int i=1;i<=n;i++) zyuni[i]=1;

	for(int i=2; i<=n; i++){
		for(int j=1; j<=i-1 ; j++){
			if(hyou[j]>hyou[i]) zyuni[i]++;
			if(hyou[j]<hyou[i]) zyuni[j]++;
			if(hyou[j]==hyou[i]) zyuni[i]++;
		}
	}
	for(int i=1; i<=n; i++) fprintf(fc,"%d\n",zyuni[i]);
	fclose(fo);
	fclose(fc);
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main()
      | ^~~~
Language: C++

#include <cstdio>

int hyou[100];

int main()
{
	int m,n;
	int zyuni[100];#include <cstdio>

int hyou[100];

int main()
{
	int m,n;
	int zyuni[100];

	while(1){
	scanf("%d %d",&m,&n);
	if(m==0&&n==0) break;
	for(int i=0; i<m; i++){
		for(int j=1; j<=n; j++){
			int kari;
			scanf("%d",&kari);
			hyou[j] += kari;
		}
	}

	for(int i=1;i<=n;i++) zyuni[i]=1;

	for(int i=2; i<=n; i++){
		for(int j=1; j<=i-1 ; j++){
			if(hyou[j]>hyou[i]) zyuni[i]++;
			if(hyou[j]<hyou[i]) zyuni[j]++;
			if(hyou[j]==hyou[i]) zyuni[i]++;
		}
	}
	for(int i=1; i<=n; i++) printf("%d ",zyuni[i]);
	}
}

	while(1){
	scanf("%d %d",&m,&n);
	if(m==0&&n==0) break;
	for(int i=0; i<m; i++){
		for(int j=1; j<=n; j++){
			int kari;
			scanf("%d",&kari);
			hyou[j] += kari;
		}
	}

	for(int i=1;i<=n;i++) zyuni[i]=1;

	for(int i=2; i<=n; i++){
		for(int j=1; j<=i-1 ; j++){
			if(hyou[j]>hyou[i]) zyuni[i]++;
			if(hyou[j]<hyou[i]) zyuni[j]++;
			if(hyou[j]==hyou[i]) zyuni[i]++;
		}
	}
	for(int i=1; i<=n; i++) printf("%d ",zyuni[i]);
	puts("");
	}
}

Compiler output:
a.cc:8:24: error: stray '#' in program
    8 |         int zyuni[100];#include <cstdio>
      |                        ^
a.cc: In function 'int main()':
a.cc:8:25: error: 'include' was not declared in this scope
    8 |         int zyuni[100];#include <cstdio>
      |                         ^~~~~~~
a.cc:8:34: error: 'cstdio' was not declared in this scope; did you mean 'stdin'?
    8 |         int zyuni[100];#include <cstdio>
      |                                  ^~~~~~
      |                                  stdin
a.cc:10:1: error: expected primary-expression before 'int'
   10 | int hyou[100];
      | ^~~
a.cc:12:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   12 | int main()
      |         ^~
a.cc:12:9: note: remove parentheses to default-initialize a variable
   12 | int main()
      |         ^~
      |         --
a.cc:12:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:13:1: error: a function-definition is not allowed here before '{' token
   13 | {
      | ^
Language: C++

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

using namespace std;

int main(){
  while(true){
    int n, m, i ,j;
    int p[100];
    for(i = 0; i < 100; i++)
      p[i] = -1;
    cin >> n >> m;
    if(!n)
      break;
    for(i = 0; i < n; i++){
      for(j = 0; j < m; j ++){
	      int input;
	      cin >> input;
	      p[j] += input;
      }
    }
    for(i = 1000; i >= 0; i--){
      for(j = 0; j < m; j++){
	      if(p[j] == i){
	        printf("%d", j + 1);
          if(j < m - 1)
          else printf("\n");
	      }
      }
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:11: error: expected primary-expression before 'else'
   29 |           else printf("\n");
      |           ^~~~
Language: C++

#include <stdio.h>
#include <vector>
#include <utility>
#include <algorithm>
#include <functional>

using namespace std;

struct int_pair_more {
  bool operator()(const pair<int,int>& x, const pair<int,int>
    return x.second > y.second;
  }
};

vector<pair<int,int> > answer(100);

int main()
{
    while(1){
        int n,m;
        scanf("%d %d", &n, &m);
        if(n == 0 && m ==0)return 0;
        for(int j=0;j<m;j++)answer[j] = make_pair(j, 0);
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                int tmp;
                scanf("%d",&tmp);
                answer[j].second += tmp;
            }
        }
        sort( answer.begin(), answer.end(), int_pair_more());
        for (int i=0;i<m-1;i++){
             printf("%d ", answer[i].first+1);
        }
        printf("%d\n", answer[m-1].first+1);
    }
}

Compiler output:
a.cc:11:5: error: expected ',' or '...' before 'return'
   11 |     return x.second > y.second;
      |     ^~~~~~
a.cc:11:31: error: expected ')' before ';' token
   11 |     return x.second > y.second;
      |                               ^
      |                               )
a.cc:10:18: note: to match this '('
   10 |   bool operator()(const pair<int,int>& x, const pair<int,int>
      |                  ^
a.cc:12:4: error: expected ';' after struct definition
   12 |   }
      |    ^
      |    ;
a.cc:13:1: error: expected declaration before '}' token
   13 | };
      | ^
Language: C++

while true do
  n, m = gets.split.map {|x| x.to_i }
  if n == 0 && m == 0 then
    break;
  end
  location = Hash.new{|h, k| h[k] = 0 }
  n.times do
    gets.split.map {|x| x.to_i }.each_with_index {|x, i| location[i+1] += x }
  end
  puts location.sort {|a,b| b[1] <=> a[1] }.map {|x| x[0] }.join ' '
end

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while true do
      | ^~~~~
a.cc:3:3: error: expected unqualified-id before 'if'
    3 |   if n == 0 && m == 0 then
      |   ^~
a.cc:5:3: error: 'end' does not name a type
    5 |   end
      |   ^~~
a.cc:7:3: error: 'n' does not name a type
    7 |   n.times do
      |   ^
a.cc:8:33: error: expected unqualified-id before '.' token
    8 |     gets.split.map {|x| x.to_i }.each_with_index {|x, i| location[i+1] += x }
      |                                 ^
a.cc:9:3: error: 'end' does not name a type
    9 |   end
      |   ^~~
a.cc:10:44: error: expected unqualified-id before '.' token
   10 |   puts location.sort {|a,b| b[1] <=> a[1] }.map {|x| x[0] }.join ' '
      |                                            ^
a.cc:10:60: error: expected unqualified-id before '.' token
   10 |   puts location.sort {|a,b| b[1] <=> a[1] }.map {|x| x[0] }.join ' '
      |                                                            ^
Language: C++

#include <iostream>
#include <functional>
#include <map>
#include <stack>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <deque>
using namespace std;

int main()
{
	vector<pair<int,int> > place;
	int n,m,count[101] = {1000},ans[1001][100];

	while(1)
	{
		cin>>n>>m;
		if(n == 0 && m == 0)break;

		for(int i=1; i<=n; i++){
			for(int j=1; j<=m; j++){
				cin>>ans[i][j];
			}
		}

		for(int i=1; i<=n; i++){
			for(int j=1; j<=m; j++){
				if(ans[i][j])
					count[j]--;
			}
		}

		for(int i=m; i>0; i--)
			place.push_back(make_pair(count[i],i));

		stable_sort(place.begin(),place.end());
	}

	vector<pair<int,int> >::iterator it = place.begin();
	while(it != place.end())
	{
		cout<<(*it).second<<endl;
		++it;
	}

	vector<pair<int,int> >::iterator it = place.begin();
	while(it != place.end())
	{
		cout<<(*it).second<<endl;
		++it;
	}

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:42: error: redeclaration of 'std::vector<std::pair<int, int> >::iterator it'
   48 |         vector<pair<int,int> >::iterator it = place.begin();
      |                                          ^~
a.cc:41:42: note: 'std::vector<std::pair<int, int> >::iterator it' previously declared here
   41 |         vector<pair<int,int> >::iterator it = place.begin();
      |                                          ^~
Language: Java

public class Main {
	public static void main(String[] args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String line[] = br.readLine().split(" ");
			int n = Integer.parseInt(line[0]);
			if(n==0){break;}
			String answer = br.readLine().split(" ")[0];

			for(int i=0; i<n; i++){
				String result = "";
				char previous = 0;
				int count = 0;

				for(int j=0; j<answer.length(); j++){
					char now = answer.charAt(j);
					if(now == previous){
						count++;
					}else{
						if(count!=0){result += count; result += previous;}
						previous = now;
						count = 1;
					}
				}
				result += count; result += previous;
				answer = result;
			}
			System.out.println(answer);
		}
	}
}

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

public class Q_0506 {
        public static void main(String[] args){
                if(args.length < 2){
                        System.err.println("too few argument");
                        return;
                }

                String numCode = args[1];
                for(int i=0; i<Integer.parseInt(args[0]); i++)
                        numCode = zip(numCode);
                System.out.println(numCode);
        }

        static String zip(String numCode){
                if(numCode.length() == 0)
                        return "";

                char top = numCode.charAt(0);
                String underCode = numCode.substring(1);

                int i;
                for(i=0; i<underCode.length(); i++){
                        if(top != underCode.charAt(i))
                                break;
                }

                return (i+1) + String.valueOf(top) +
                        zip(underCode.substring(i));
        }
}

Compiler output:
Main.java:1: error: class Q_0506 is public, should be declared in a file named Q_0506.java
public class Q_0506 {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
        public static void main(String[] args){
                try{
                        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                        while(true){
                                String count = in.readLine();
                                if( count.equals("0") )  break;
                                String numCode = in.readLine();

try{
                                for(int i=0; i<Integer.parseInt(count); i++)
                                        numCode = zip(numCode);
                                System.out.println(numCode);
}catch(StackOverFlowException e){
e.printStackTrace();
}
                        }
                }catch(IOException e){
                        e.printStackTrace();
                }
        }

        static String zip(String numCode){
                if(numCode.length() == 0)
                        return "";

                char top = numCode.charAt(0);
                String underCode = numCode.substring(1);

                int i;
                for(i=0; i<underCode.length(); i++){
                        if(top != underCode.charAt(i))
                                break;
                }

                return (i+1) + String.valueOf(top) +
                        zip(underCode.substring(i));
        }
}

Compiler output:
Main.java:18: error: cannot find symbol
}catch(StackOverFlowException e){
       ^
  symbol:   class StackOverFlowException
  location: class Main
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
        public static void main(String[] args){
                try{
                        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                        while(true){
                                String count = in.readLine();
                                if( count.equals("0") )  break;
                                String numCode = in.readLine();

try{
                                for(int i=0; i<Integer.parseInt(count); i++)
                                        numCode = zip(numCode);
                                System.out.println(numCode);
}catch(StackOverFlowError e){
e.printStackTrace();
}
                        }
                }catch(IOException e){
                        e.printStackTrace();
                }
        }

        static String zip(String numCode){
                if(numCode.length() == 0)
                        return "";

                char top = numCode.charAt(0);
                String underCode = numCode.substring(1);

                int i;
                for(i=0; i<underCode.length(); i++){
                        if(top != underCode.charAt(i))
                                break;
                }

                return (i+1) + String.valueOf(top) +
                        zip(underCode.substring(i));
        }
}

Compiler output:
Main.java:18: error: cannot find symbol
}catch(StackOverFlowError e){
       ^
  symbol:   class StackOverFlowError
  location: class Main
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
        public static void main(String[] args){
                StringBuilder result = new StringBuilder();
                try{
                        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                        while(true){
                                String count = in.readLine();
                                if( count.equals("0") || Integer.parseInt(count) > 20 )  break;
                                String numCode = in.readLine();
                                if( numCode.length() > 100 )  break;

                                for(int i=0; i<Integer.parseInt(count); i++)
                                        numCode = zip(numCode);
                                result.append(numCode + "\n");
                        }
                }catch(IOException e){
                        e.printStackTrace();
                }
                System.out.println(result);
        }

        static String zip(String numCode){
                if(numCode.length() == 0)
                        return "";

                char top = numCode.charAt(0);
                String underCode = numCode.substring(1);

                int i;
                for(i=0; i<underCode.length(); i++){
                        if(top != underCode.charAt(i))
                                break;
                }

                return (i+1) + String.valueOf(top) +
                        zip(underCode.substring(i));
        }
}\

Compiler output:
Main.java:42: error: illegal character: '\'
}\
 ^
Main.java:42: error: reached end of file while parsing
}\
  ^
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
        public static void main(String[] args){
                StringBuilder result = new StringBuilder();
bool flag = false;
                try{
                        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                        while(true){
                                String count = in.readLine();
                                if( count.equals("0") || Integer.parseInt(count) > 20 )  break;
                                String numCode = in.readLine();
                                if( numCode.length() > 100 )  break;

                                for(int i=0; i<Integer.parseInt(count); i++)
                                        numCode = zip(numCode);
                                result.append(numCode + "\n");
                        }
                }catch(IOException e){
                        e.printStackTrace();flag=true;
                }catch(RuntimeException e){System.out.println("HOGE");flag=true;}
                if(!flag)System.out.print(result);
        }

        static String zip(String numCode){
                if(numCode.length() == 0)
                        return "";

                char top = numCode.charAt(0);
                String underCode = numCode.substring(1);

                int i;
                for(i=0; i<underCode.length(); i++){
                        if(top != underCode.charAt(i))
                                break;
                }

                return (i+1) + String.valueOf(top) +
                        zip(underCode.substring(i));
        }
}

Compiler output:
Main.java:8: error: cannot find symbol
bool flag = false;
^
  symbol:   class bool
  location: class Main
1 error
Language: C

#include <cstdio>
#include <iostream>

typedef struct {
	char number;
	char num;
} NUMBER;

NUMBER N[2048];

using namespace std;

int main()
{
	char str[2048];
	int n;
	
	while (cin >> n, n){
		cin >> str;
		
		memset(N, 0, sizeof(N));
		
		for (int c = 0; c < n; c++){
			int i = 0;
			int j = 0;
			while (str[i] != '\0'){
				if (i > 0 && str[i] == str[i-1]){
					N[j-1].num++;
				}
				else {
					N[j].number = str[i];
					N[j].num = '1';
					j++;
				}
				
				i++;
			}
			
			strcpy(str, "");
			
			for (int i = 0; i < j; i++){
				strncat(str, &N[i].number, 1);
				strncat(str, &N[i].num, 1);
			}
		}
		
		printf("%s\n", str);
	}
	
	return (0);
}

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

#include<stdio.h>

int main(void){
	int n,i,j,count;
	char s[101],t[101];

	while(scanf("%d".&n),n){
		count=0;
		scanf("%s",s);
		while(n--){
			for(i=0;s[i]!='\0';i++){
				for(j=0;s[i]==s[j];j++);
				if(j>99){
					t[count++]=j/100;
					j%=100;
					t[count++]=j/10;
					j%=10;
					t[count++]=j;
					t[count++]=s[i];
				}else if(j>9){
					t[count++]=j/10;
					j%=10;
					t[count++]=j;
					t[count++]=s[i];
				}else{
					t[count++]=j;
					t[count++]=s[i];
				}
				i=j;
			}
			for(i=0;i<101;i++){
				s[i]=t[i];
				t[i]=0;
			}
		}
	printf("%s\n",s);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:26: error: expected identifier before '&' token
    7 |         while(scanf("%d".&n),n){
      |                          ^
Language: C

#include <stdio.h>
#include <string.h>
??
int main(void)
{
????int n;
????char s[364364], tmp[364364], res[364364];
????int i, j;
????int cnt, len;
??
????while (scanf("%d", &n), n){
????????scanf("%s", s);
????????for (i = 0; i < n; i++){
????????????cnt = 1;
????????????*res = '\0';
????????????len = strlen(s);
????????????for (j = 0; j < len; j++){
????????????????if (s[j] == s[j + 1]){
????????????????????cnt++;
????????????????}
????????????????else {
????????????????????sprintf(tmp, "%d%c", cnt, s[j]);
????????????????????strcat(res, tmp);
????????????????????cnt = 1;
????????????????}
????????????}
????????????strcpy(s, res);
????????}
????????printf("%s\n", s);
????}
??
????return (0);
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??
      | ^
Language: C

#include <stdio.h>
#include <string.h>
int main(){
for(;;){
char str[100000],strcopy[100000];
int a,b=0,sum=1,leng;
    scanf("%d",&a);
    if(a==0) break;
    scanf("%s",str);
    leng=strlen(str);
    for(j=0;j<a;j++){
    for(i=1;i<strlen(str);i++){
        if(str[i-1]==str[i]){
            sum++;
        }else{
            if(sum>=10){
               strcopy[b]=sum/10+'0';
                strcopy[b+1]=sum%10+'0';
                strcopy[b+2]=str[i-1];
                b+=3;
                sum=1;
            }else{
                strcopy[b]=sum+'0';
                strcopy[b+1]=str[i-1];
                b+=2;
                sum=1;
            }
        }
    }
        if(sum>=10){
            strcopy[b]=sum/10+'0';
            strcopy[b+1]=sum%10+'0';
            strcopy[b+2]=str[strlen(str)-1];
            b+=3;
            sum=1;
        }else{
            strcopy[b]=sum+'0';
            strcopy[b+1]=str[strlen(str)-1];
            b+=2;
            sum=1;
        }
        leng=strlen(strcopy);
        strcpy(str,"");
            strncpy(str,strcopy,leng);
        strcpy(strcopy,"");
        b=0;
        }
    puts(str);
}
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:9: error: 'j' undeclared (first use in this function)
   11 |     for(j=0;j<a;j++){
      |         ^
main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:9: error: 'i' undeclared (first use in this function)
   12 |     for(i=1;i<strlen(str);i++){
      |         ^
Language: C

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

char StrCount();

main(void){
    int num;
    char str[100];
    
    scanf("%d", &num);
    scanf("%s", str);
    
    for( ; num > 0; num--){
        str = StrCount(str);
    }
    
    return 0;
}

char StrCount(char str[100]){
    int i =0, m, cnt = 0;
    char target,restr[] = "";
    
    target = str[0];
    for( m = strlen(str); i <= m; i++){
        if( target == str[i]){
            cnt++;
        }else{
            if( i == 0){
                restr = sprintf(restr, "1%c", str[0]);
            }else{
                restr = sprintf(restr, "%s%c", cnt, str[i-1]);
            }
        }
    }
    
    return restr;
}

Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main(void){
      | ^~~~
main.c: In function 'main':
main.c:14:13: error: assignment to expression with array type
   14 |         str = StrCount(str);
      |             ^
main.c: In function 'StrCount':
main.c:30:23: error: assignment to expression with array type
   30 |                 restr = sprintf(restr, "1%c", str[0]);
      |                       ^
main.c:32:23: error: assignment to expression with array type
   32 |                 restr = sprintf(restr, "%s%c", cnt, str[i-1]);
      |                       ^
main.c:37:12: error: returning 'char *' from a function with return type 'char' makes integer from pointer without a cast [-Wint-conversion]
   37 |     return restr;
      |            ^~~~~
Language: C++

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

typedef stringstream ss;
template<class T> inline string toStr(T f){ ss sss; sss << f; return sss.str(); }

int main(){
  
  int n;
  while(cin >> n, n){
    string now, prev; cin >> prev;
    
    for(int i = 0; i < n; i++){
      int cnt;
      for(int j = 0; j < prev.size(); j+=cnt){
	cnt = 0;
	for(int k = j; prev[k] == prev[j]; k++, cnt++);
	now.append(toStr(cnt));
	now.append(1, prev[j]);
      }
      prev = now;
      now = "";
    }
     
    cout << prev << endl;
  }

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

#include <cstdio>
#include <iostream>

typedef struct {
	char number;
	char num;
} NUMBER;

NUMBER N[2048];

using namespace std;

int main()
{
	char str[2048];
	int n;
	
	while (cin >> n, n){
		cin >> str;
		
		memset(N, 0, sizeof(N));
		
		for (int c = 0; c < n; c++){
			int i = 0;
			int j = 0;
			while (str[i] != '\0'){
				if (i > 0 && str[i] == str[i-1]){
					N[j-1].num++;
				}
				else {
					N[j].number = str[i];
					N[j].num = '1';
					j++;
				}
				
				i++;
			}
			
			strcpy(str, "");
			
			for (int i = 0; i < j; i++){
				strncat(str, &N[i].number, 1);
				strncat(str, &N[i].num, 1);
			}
		}
		
		printf("%s\n", str);
	}
	
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'memset' was not declared in this scope
   21 |                 memset(N, 0, sizeof(N));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 | 
a.cc:39:25: error: 'strcpy' was not declared in this scope
   39 |                         strcpy(str, "");
      |                         ^~~~~~
a.cc:39:25: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:42:33: error: 'strncat' was not declared in this scope
   42 |                                 strncat(str, &N[i].number, 1);
      |                                 ^~~~~~~
a.cc:42:33: note: 'strncat' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

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

using namespace std;

int main(){
  string str1;
  int n =0;
  while(1){
    cin >> n;
    if(n == 0) break;
    cin >> str1;
    stringstream ss;
    char num = str1[0];
    
    for(int i = 0; i< n; i++){
      int count = 1;
      for(int j = 0; j< str1.length(); j++){
	if(figure == str[j]) count++;
	else{
	  ss << count << num;
	  count = 1;
	  num = str[j];
	}
      }

      ss <<count<< num;

      str1 = ss.str();
      ss.str("");
    }

    cout << str << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'figure' was not declared in this scope
   20 |         if(figure == str[j]) count++;
      |            ^~~~~~
a.cc:20:22: error: 'str' was not declared in this scope; did you mean 'str1'?
   20 |         if(figure == str[j]) count++;
      |                      ^~~
      |                      str1
a.cc:34:13: error: 'str' was not declared in this scope; did you mean 'str1'?
   34 |     cout << str << endl;
      |             ^~~
      |             str1
Language: C++

#include<iostream>

using namespace std;

char words[21][100000],words2[100000][101],result[100][100000];
int n, counter, counter2;

int main()
{
	for (;;)
	{
		cin >> n;
		if (n == 0)
		{
			break;
		}

		counter++;

		cin >> words[0];

		int i = 0;

		for (int a = 0; a < n; a++)
		{
			for (int b = 0;; b++)
			{
				counter2++;
				if (words[a][b] != words[a][b + 1])
				{
					_itoa_s(counter2, words2[i], 10);
					words2[i + 1][0] = words[a][b];
					i += 2;
					counter2 = 0;
				}
				if (words[a][b] == *"")
				{
					int q = 0;
					counter2 = 0;
					for (int m = 0; m < i; m++)
					{
						int u = 0;
						while (words2[m][u] != *"")
						{
							words[a + 1][q] = words2[m][u];
							u++;
							q++;
						}
					}
					i = 0;
					break;
				}
			}
		}

		int r = 0;

		while (words[n][r] != *"")
		{
			result[counter-1][r] = words[n][r];
			r++;
		}
	}

	for (int o = 0; o < counter; o++)
	{
		cout << result[o] << endl;
	}

	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:41: error: '_itoa_s' was not declared in this scope
   31 |                                         _itoa_s(counter2, words2[i], 10);
      |                                         ^~~~~~~
Language: C++

#include<iostream>
#include<stdlib.h>

using namespace std;

char words[21][100000],words2[100000][101],result[100][100000];
int n, counter, counter2;

int main()
{
	for (;;)
	{
		cin >> n;
		if (n == 0)
		{
			break;
		}

		counter++;

		cin >> words[0];

		int i = 0;

		for (int a = 0; a < n; a++)
		{
			for (int b = 0;; b++)
			{
				counter2++;
				if (words[a][b] != words[a][b + 1])
				{
					_itoa_s(counter2, words2[i], 10);
					words2[i + 1][0] = words[a][b];
					i += 2;
					counter2 = 0;
				}
				if (words[a][b] == *"")
				{
					int q = 0;
					counter2 = 0;
					for (int m = 0; m < i; m++)
					{
						int u = 0;
						while (words2[m][u] != *"")
						{
							words[a + 1][q] = words2[m][u];
							u++;
							q++;
						}
					}
					i = 0;
					break;
				}
			}
		}

		int r = 0;

		while (words[n][r] != *"")
		{
			result[counter-1][r] = words[n][r];
			r++;
		}
	}

	for (int o = 0; o < counter; o++)
	{
		cout << result[o] << endl;
	}

	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:41: error: '_itoa_s' was not declared in this scope
   32 |                                         _itoa_s(counter2, words2[i], 10);
      |                                         ^~~~~~~
Language: C++

#include<iostream>
#include<stdlib.h>

using namespace std;

char words[21][100000],words2[100000][101],result[100][100000];
int n, counter, counter2;

int main()
{
	for (;;)
	{
		cin >> n;
		if (n == 0)
		{
			break;
		}

		counter++;

		cin >> words[0];

		int i = 0;

		for (int a = 0; a < n; a++)
		{
			for (int b = 0;; b++)
			{
				counter2++;
				if (words[a][b] != words[a][b + 1])
				{
					itoa(counter2, words2[i], 10);
					words2[i + 1][0] = words[a][b];
					i += 2;
					counter2 = 0;
				}
				if (words[a][b] == *"")
				{
					int q = 0;
					counter2 = 0;
					for (int m = 0; m < i; m++)
					{
						int u = 0;
						while (words2[m][u] != *"")
						{
							words[a + 1][q] = words2[m][u];
							u++;
							q++;
						}
					}
					i = 0;
					break;
				}
			}
		}

		int r = 0;

		while (words[n][r] != *"")
		{
			result[counter-1][r] = words[n][r];
			r++;
		}
	}

	for (int o = 0; o < counter; o++)
	{
		cout << result[o] << endl;
	}

	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:41: error: 'itoa' was not declared in this scope
   32 |                                         itoa(counter2, words2[i], 10);
      |                                         ^~~~
Language: C++

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

using namespace std;

char words[21][100000],words2[100000][101],result[100][100000];
int n, counter, counter2;

int main()
{
	for (;;)
	{
		cin >> n;
		if (n == 0)
		{
			break;
		}

		counter++;

		cin >> words[0];

		int i = 0;

		for (int a = 0; a < n; a++)
		{
			for (int b = 0;; b++)
			{
				counter2++;
				if (words[a][b] != words[a][b + 1])
				{
					_itoa_s(counter2, words2[i], 10);
					words2[i + 1][0] = words[a][b];
					i += 2;
					counter2 = 0;
				}
				if (words[a][b] == *"")
				{
					int q = 0;
					counter2 = 0;
					for (int m = 0; m < i; m++)
					{
						int u = 0;
						while (words2[m][u] != *"")
						{
							words[a + 1][q] = words2[m][u];
							u++;
							q++;
						}
					}
					i = 0;
					break;
				}
			}
		}

		int r = 0;

		while (words[n][r] != *"")
		{
			result[counter-1][r] = words[n][r];
			r++;
		}
	}

	for (int o = 0; o < counter; o++)
	{
		cout << result[o] << endl;
	}

	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:41: error: '_itoa_s' was not declared in this scope
   33 |                                         _itoa_s(counter2, words2[i], 10);
      |                                         ^~~~~~~
Language: C++

#include<iostream>

using namespace std;

char words[21][1000000],words2[1000000][101],result[100][1000000];
int n, counter, counter2;

int main()
{
	for (;;)
	{
		cin >> n;
		if (n == 0)
		{
			break;
		}

		counter++;

		cin >> words[0];

		int i = 0;

		for (int a = 0; a < n; a++)
		{
			for (int b = 0;; b++)
			{
				counter2++;
				if (words[a][b] != words[a][b + 1])
				{
					_itoa_s(counter2, words2[i], 10);
					words2[i + 1][0] = words[a][b];
					i += 2;
					counter2 = 0;
				}
				if (words[a][b] == *"")
				{
					int q = 0;
					counter2 = 0;
					for (int m = 0; m < i; m++)
					{
						int u = 0;
						while (words2[m][u] != *"")
						{
							words[a + 1][q] = words2[m][u];
							u++;
							q++;
						}
					}
					i = 0;
					break;
				}
			}
		}

		int r = 0;

		while (words[n][r] != *"")
		{
			result[counter-1][r] = words[n][r];
			r++;
		}
	}

	for (int o = 0; o < counter; o++)
	{
		cout << result[o] << endl;
	}


	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:41: error: '_itoa_s' was not declared in this scope
   31 |                                         _itoa_s(counter2, words2[i], 10);
      |                                         ^~~~~~~
Language: C++

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

int main()
{
	int n, b = 0, c = 0;
	string Istr, Ostr;
	char chi;
	ostringstream oss;
	char ch;
	cin >> n;
	do {
		cin >> Istr;
		while (n--) {
			for (int i = 0; i < (int)Istr.size();) {
				ch = Istr[i];
				for (int j = i; i < (int)Istr.size(); j++) {
					if (Istr[i] == Istr[j]) {
						b++;
					}
					else
					{
						i = j;
						break;
					}
				}
				itoa(b, &chi, 10);
				Ostr.push_back(chi);
				Ostr.push_back(ch);
				//oss.clear();
				b = 0;
				//if ((i >= (int)Istr.size()) == true) {
				//	break;
				//}
			}
			Istr.clear();
			Istr = Ostr;
			Ostr.clear();
		}
		cout << Istr << endl;
	} while (cin >> n);
	return 0;
}

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

#include <iostream>
#include <string>
using namespace std;
template < typename T > std::string to_string(const T& n)
{
	std::ostringstream stm;
	stm << n;
	return stm.str();
}
int main()
{
	int n, b = 0, c = 0;
	string Istr, Ostr;
	char ch;
	cin >> n;
	do {
		cin >> Istr;
		while (n--) {
			for (int i = 0; i < (int)Istr.size();) {
				ch = Istr[i];
				for (int j = i; i < (int)Istr.size(); j++) {
					if (Istr[i] == Istr[j]) {
						b++;
					}
					else
					{
						i = j;
						break;
					}
				}
				Ostr += to_string(b);
				Ostr.push_back(ch);
				b = 0;
			}
			Istr.clear();
			Istr = Ostr;
			Ostr.clear();
		}
		cout << Istr << endl;
		cin >> n;
	} while (n != 0);
	return 0;
}

Compiler output:
a.cc: In function 'std::string to_string(const T&)':
a.cc:6:28: error: 'stm' has incomplete type
    6 |         std::ostringstream stm;
      |                            ^~~
In file included from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/iosfwd:106:11: note: declaration of 'std::ostringstream' {aka 'class std::__cxx11::basic_ostringstream<char>'}
  106 |     class basic_ostringstream;
      |           ^~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <ostream>
#include <string>
using namespace std;
template < typename T > std::string to_string(const T& n)
{
	std::ostringstream stm;
	stm << n;
	return stm.str();
}
int main()
{
	int n, b = 0, c = 0;
	string Istr, Ostr;
	char ch;
	cin >> n;
	do {
		cin >> Istr;
		while (n--) {
			for (int i = 0; i < (int)Istr.size();) {
				ch = Istr[i];
				for (int j = i; i < (int)Istr.size(); j++) {
					if (Istr[i] == Istr[j]) {
						b++;
					}
					else
					{
						i = j;
						break;
					}
				}
				Ostr += to_string(b);
				Ostr.push_back(ch);
				b = 0;
			}
			Istr.clear();
			Istr = Ostr;
			Ostr.clear();
		}
		cout << Istr << endl;
		cin >> n;
	} while (n != 0);
	return 0;
}

Compiler output:
a.cc: In function 'std::string to_string(const T&)':
a.cc:7:28: error: 'stm' has incomplete type
    7 |         std::ostringstream stm;
      |                            ^~~
In file included from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/iosfwd:106:11: note: declaration of 'std::ostringstream' {aka 'class std::__cxx11::basic_ostringstream<char>'}
  106 |     class basic_ostringstream;
      |           ^~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <ostringstream>
#include <string>
using namespace std;
template < typename T > std::string to_string(const T& n)
{
	std::ostringstream stm;
	stm << n;
	return stm.str();
}
int main()
{
	int n, b = 0, c = 0;
	string Istr, Ostr;
	char ch;
	cin >> n;
	do {
		cin >> Istr;
		while (n--) {
			for (int i = 0; i < (int)Istr.size();) {
				ch = Istr[i];
				for (int j = i; i < (int)Istr.size(); j++) {
					if (Istr[i] == Istr[j]) {
						b++;
					}
					else
					{
						i = j;
						break;
					}
				}
				Ostr += to_string(b);
				Ostr.push_back(ch);
				b = 0;
			}
			Istr.clear();
			Istr = Ostr;
			Ostr.clear();
		}
		cout << Istr << endl;
		cin >> n;
	} while (n != 0);
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: ostringstream: No such file or directory
    2 | #include <ostringstream>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <fstream>
#include <cstdlib>
#include <vector>
using namespace std;
vector<int> func(vector<int> s);
int main(){
    ifstream in("input.txt");
    int n;
    vector<int> s;
    in >> n;
    char c;
    while(in>>c){
        s.push_back(atoi(c));
    }
    for(int i=0; i<n; i++){
        s = func(s);
    }
    
    ofstream out("output.txt");
    for(i=0; i<s.size(); i++){
        out << s[i];
    }
    out<<endl;
    return 0;
}

vector<int> func(vector<int> s){
    int sindex=1;
    int count=1, p=s[0];
    vector<int> a;
    
    while(1){
        if(sindex==s.size()-1){
            a.push_back(count);
            a.push_back(p);
            break;
        }
        if(s[sindex-1]==s[sindex]){
            count+=1;
            sindex+=1;
            continue;
        }
        if(s[sindex-1]!=s[sindex]){
            a.push_back(count);
            a.push_back(p);
            count=1;
            p=s[sindex];
            sindex+=1;
            continue;
        }
    }
    
    return a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   14 |         s.push_back(atoi(c));
      |                          ^
      |                          |
      |                          char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:21:9: error: 'i' was not declared in this scope
   21 |     for(i=0; i<s.size(); i++){
      |         ^
Language: C++

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

int main() {
	int n;
	string s;
	while (cin >> n, n) {
		cin >> s;
		
		for (int x = 0;x < n;x++) {
			s += '@';
			string sg="";

			char now = s[0];
			int ko = 0;

			for (int i = 0;i < s.size();i++) {
				if (s[i] == now)ko++;
				else {
					string sa = to_string(ko);
					sg += sa;
					sg.push_back(now);
					now = s[i];
					ko = 1;
				}
			}
			s = sg;
		}

		cout << s << endl;

	}
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<deque>

int n;
int ToStr(int str[]);
int str_max;

using namespace std;

int main()
{
	char str[101];
	int i;
	int str_int[101];
	for(;;){
	cin >> n;
	if(n  == 0){
		break;
	}
	
	cin >> str;
	for(i = 0; str[i] != '\0'; i++){
		str_int[i] = (char)str[i];
	}
	for(i = 0; str[i] != '\0'; i++){
		str_int[i] -= 48;
	}
	str_int[i] = 0;
	str_max = strlen(str);
	ToStr(&str_int[0]);
}
}

int ToStr(int str[])
{
	int temp, i;
	int cont, cont2 = 0;
	int data[50][2];
	deque<int> str2(1, 0);
	for(i = 0;; i++){
		cont = 1;
		temp = str[i];
		if(temp == 0){
			break;
		}
		for(;;){
			if(temp != str[i+1]){
				break;
			}
			else{
				
				cont++;
				i++;
			}
		}
//		cout << temp <<"ツつェ" << cont << "ツ嘉ア" << endl;
		data[cont2][0] = cont;
		data[cont2][1] = temp;
//		printf(" data[%d][0]:%d", cont2,data[cont2][0]);
//		printf(" data[%d][1]:%d\n", cont2,data[cont2][1]);
		cont2++;
	}
	temp = cont2;
	for(; cont2 > 0; cont2--){
		str2.push_front(data[cont2-1][1]);
		str2.push_front(data[cont2-1][0]);
	}
	
//	cout << endl;
//	cout << "/***********ツ終ツ猟ケ**************/" << endl;
	
	if(n == 1){
		for(i = 0; i < temp * 2; i++){
			cout << str2[i] ;
		}
		cout << endl;
		return 0;
	}
	else{
		n--;
		return ToStr(&str2[0]);
	}
}
			

Compiler output:
a.cc: In function 'int main()':
a.cc:29:19: error: 'strlen' was not declared in this scope
   29 |         str_max = strlen(str);
      |                   ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<deque>
  +++ |+#include <cstring>
    3 |
Language: C++

/*
vOÌ³ÊÈcoutÍÁµÜµå¤
*/

#include<iostream>
#include<deque>
#include<string.h>
#include<windows.h>

int n;
int ToStr(int str[]);
int str_max;

using namespace std;

int main()
{
	char str[101];
	int i;
	int str_int[101];
	for(;;){
	cin >> n;
	if(n  == 0){
		break;
	}
	
	cin >> str;
	for(i = 0; str[i] != '\0'; i++){
		str_int[i] = (char)str[i];
	}
	for(i = 0; str[i] != '\0'; i++){
		str_int[i] -= 48;
	}
	str_int[i] = -1;
	str_max = strlen(str);
	ToStr(&str_int[0]);
}
}

int ToStr(int str[])
{
	int temp, i;
	int cont, cont2 = 0;
	int data[101][2];
	deque<int> str2;
	for(i = 0;; i++){
		cont = 1;
		temp = str[i];
		if(temp == -1){
			break;
		}
			for(;;){
				if(temp != str[i+1]){
					break;
				}
				else{
					cont++;
					i++;
				}
//				cout << "*" << endl;
			}
//		cout << temp <<"ª" << cont << "ñ" << endl;
		data[cont2][0] = cont;
		data[cont2][1] = temp;
//		printf(" data[%d][0]:%d", cont2,data[cont2][0]);
//		printf(" data[%d][1]:%d\n", cont2,data[cont2][1]);
		cont2++;
	}
	temp = cont2;
	for(; cont2 > 0; cont2--){
		str2.push_front(data[cont2-1][1]);
		str2.push_front(data[cont2-1][0]);
	}
	
//	cout << "/***********I¹**************/" << endl;
//	Sleep(10000);
	if(n == 1){
		for(i = 0; i < temp * 2; i++){
			cout << str2[i];
		}
		cout << endl;
		return 0;
	}
	else{
		n--;
		str2.push_back(-1);
		
//		cout << "*";
		for(i = 0; i < temp * 2; i++){
//			cout << str2[i];
		}
//		cout << endl;
		
		return ToStr(&str2[0]);
	}
}
			

Compiler output:
a.cc:8:9: fatal error: windows.h: No such file or directory
    8 | #include<windows.h>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

char s[65536],t[65536];
int n,i,r,w,c,a;
int main()
{
	while(scanf("%d",&n),n){
		scanf("%s",s);
		for(i=0;i<n;++i){
			r=w=0;
			while(r<strlen(s)){
				a=s[r];
				for(c=0;s[r+c]==a;++c);
				sprintf(t+w,"%d\0",c);
				while(t[++w]);
				t[w++]=a;
				r+=c;
			}
			t[w]=0;
			strcpy(s,t);
		}
		puts(s);
	}
	exit(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'scanf' was not declared in this scope
    5 |         while(scanf("%d",&n),n){
      |               ^~~~~
a.cc:9:33: error: 'strlen' was not declared in this scope
    9 |                         while(r<strlen(s)){
      |                                 ^~~~~~
a.cc:1:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | char s[65536],t[65536];
a.cc:12:33: error: 'sprintf' was not declared in this scope
   12 |                                 sprintf(t+w,"%d\0",c);
      |                                 ^~~~~~~
a.cc:1:1: note: 'sprintf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | char s[65536],t[65536];
a.cc:18:25: error: 'strcpy' was not declared in this scope
   18 |                         strcpy(s,t);
      |                         ^~~~~~
a.cc:18:25: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:20:17: error: 'puts' was not declared in this scope
   20 |                 puts(s);
      |                 ^~~~
a.cc:22:9: error: 'exit' was not declared in this scope
   22 |         exit(0);
      |         ^~~~
a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
  +++ |+#include <cstdlib>
    1 | char s[65536],t[65536];
Language: C++

char s[65536],t[65536];main(n,i,r,w,c){for(;scanf("%d",&n),n;puts(s))for(i=!scanf("%s",s);i++<n;t[w]=0,strcpy(s,t))for(r=w=0;r<strlen(s);t[w++]=s[r],r+=c){for(c=0;s[++c+r]==s[r];);for(sprintf(t+w,"%d\0",c);t[++w];);}}

Compiler output:
a.cc:1:28: error: expected constructor, destructor, or type conversion before '(' token
    1 | char s[65536],t[65536];main(n,i,r,w,c){for(;scanf("%d",&n),n;puts(s))for(i=!scanf("%s",s);i++<n;t[w]=0,strcpy(s,t))for(r=w=0;r<strlen(s);t[w++]=s[r],r+=c){for(c=0;s[++c+r]==s[r];);for(sprintf(t+w,"%d\0",c);t[++w];);}}
      |                            ^
Language: C++

#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<sstream>

using namespace std;

int main(){
		int n,num,cont,v;
		string a,nex;
				stringstream ss;
				char a[100];
	while(1){
		
		scanf("%d",&n);
		
		if(n==0){break;}
		cin>>a;
		
		for(int i=0;i<n;i++){
			cont=0;
			while(1){
				if(cont>=a.size()){break;}
				
				num=a[cont];
				
				v=0;
				while(1){
					if(a[cont]!=num){break;}
					v++;
					cont++;
				}
				/*
				ss.str("");
				ss<<v;*/
				
				sprintf(a,"%d",v);
				nex+=a;
				
				//nex+=ss.str();
				nex+=num;
			}
			a=nex;
			nex="";
		}
			cout<<a<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:38: error: conflicting declaration 'char a [100]'
   13 |                                 char a[100];
      |                                      ^
a.cc:11:24: note: previous declaration as 'std::string a'
   11 |                 string a,nex;
      |                        ^
a.cc:38:41: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
   38 |                                 sprintf(a,"%d",v);
      |                                         ^
      |                                         |
      |                                         std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdio:42,
                 from a.cc:1:
/usr/include/stdio.h:365:38: note:   initializing argument 1 of 'int sprintf(char*, const char*, ...)'
  365 | extern int sprintf (char *__restrict __s,
      |                     ~~~~~~~~~~~~~~~~~^~~
Language: C++

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

using namespace std;

int main(){
		int n,num,cont,v;
		string a,nex;
				stringstream ss;
				char bin[100];
	while(1){
		
		scanf("%d",&n);
		
		if(n==0){break;}
		cin>>a;
		
		for(int i=0;i<n;i++){
			cont=0;
			while(1){
				if(cont>=a.size()){break;}
				
				num=a[cont];
				
				v=0;
				while(1){
					if(a[cont]!=num){break;}
					v++;
					cont++;
				}
				/*
				ss.str("");
				ss<<v;*/
				
				itoa(v,bin,10);
				nex+=bin;
				
				//nex+=ss.str();
				nex+=num;
			}
			a=nex;
			nex="";
		}
			cout<<a<<endl;
	}
}

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