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

#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;


int n, m;
int ans;

inline int msb(int x) {
	if(!x) return 0;
	return (1 << (31 - __builtin_clz(x)));
}


void dfs(vector<int> state, vector<int> prev, int cnt = 0) {
	if(cnt > min(m, ans))
		return;

	if(state[0] == (1 << n) - 1 || state[2] == (1 << n) - 1) {
		ans = cnt;
		return;
	}

	for(int i = 0; i < 2; ++i) {
		int move = max(msb(state[i]), msb(state[i + 1]));
		vector<int> next = state;
		next[i] ^= move;
		next[i + 1] ^= move;
		if(next != state)
			dfs(next, state, cnt + 1);
	}	
	
}

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

	const vector<int> init(3, -1);

	for(; cin >> n >> m, n | m;) {
		vector<int> cup(3, 0);

		for(int i = 0; i < 3; ++i) {
			int num;
			cin >> num;

			for(int j = 0; j < num; ++j) {
				int size;
				cin >> size;
				--size;

				cup[i] |= (1 << size);
			}
		}

		ans = INT_MAX;
		dfs(cup, init);

		cout << (ans == INT_MAX ? -1 : ans) << endl;
	}

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:16: error: no matching function for call to 'std::basic_istream<char>::tie(bool)'
   38 |         cin.tie(false);
      |         ~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/basic_ios.h:299:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie() const [with _CharT = char; _Traits = std::char_traits<char>]'
  299 |       tie() const
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:299:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/basic_ios.h:311:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>* std::basic_ios<_CharT, _Traits>::tie(std::basic_ostream<_CharT, _Traits>*) [with _CharT = char; _Traits = std::char_traits<char>]'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |       ^~~
/usr/include/c++/14/bits/basic_ios.h:311:43: note:   no known conversion for argument 1 from 'bool' to 'std::basic_ostream<char>*'
  311 |       tie(basic_ostream<_CharT, _Traits>* __tiestr)
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:59:23: error: 'INT_MAX' was not declared in this scope
   59 |                 ans = INT_MAX;
      |                       ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <vector>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

#include <stdio.h>
#include <stdbool.h>

#define INF 15
#define A 0
#define B 1
#define C 2

char cond[INF];
char n;
int  m;
int sum;

void move(int pos, char dist) {
    char now = cond[pos];

    if (now == dist) {
        return;
    } else if (abs(now-dist) == 2) {
        move(pos, B);
        move(pos, dist);
    } else {
        int i;
        char no_present = (dist+now == 1)?C:
                          (dist+now == 2)?B:
                                          A;
        for (i=1;pos+i < n;i++){
            if (cond[pos+i] == dist || cond[pos+i] == now) {
                move(pos+i, no_present);
            }
        }

        cond[pos] = dist;
        sum += 1;
    }

    return;
}

int main() {
    while (1) {
        int i;
        char dist;
    
        scanf("%d %d", &n, &m);
        if (n == 0 && m ==0) {
            break;
        }

        for (i=0;i < 3;i++) {
            int j,k;

            scanf("%d", &k);
            for (j=0;j < k;j++) {
                int tmp;
    
                scanf("%d", &tmp);
                cond[tmp-1] = i;
            }
        }
    
        dist = (cond[0] != B)?cond[0]:A;
    
        for (i=0;i < n;i++) {
            move(i, dist);
        }
    
        if (sum <= m) {
            printf("%d\n", sum);
        } else {
            printf("-1\n");
        }
    }
}

Compiler output:
a.cc: In function 'void move(int, char)':
a.cc:19:16: error: 'abs' was not declared in this scope
   19 |     } else if (abs(now-dist) == 2) {
      |                ^~~
Language: C

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

int main(void)
{
    int i, j;
    int n, k, m, r;
    __int64 syou, amari;
    static int farray[10021], sum[10021];
    
    while (1){
        scanf("%d%d%d%d", &n, &k, &m, &r);
        
        if (n + k + m + r == 0){
            break;
        }
        
        if (m == 0){
            amari = 1;
            syou = n;
            printf("%d.", amari / syou);
            amari %= syou;
            amari *= 10;
            for (i = 0; i < r; i++){
                printf("%d", amari / syou);
                amari %= syou;
                amari *= 10;
            }
        }
        else {
            memset(sum, 0, sizeof(sum));
            
            for (i = 0; i < n; i++){
                amari = 1;
                syou = (i == 0 ? n : n * i);
                memset(farray, 0, sizeof(farray));
                for (j = 0; j <= 10020; j++){
                    farray[j] = amari / syou;
                    amari %= syou;
                    amari *= 10;
                }
                if (i == 0){
                    memcpy(sum, farray, sizeof(farray));
                }
                else {
                    for (j = 10020; j >= 0; j--){
                        sum[j] += farray[j];
                        if (sum[j] > 9){
                            sum[j] -= 10;
                            sum[j - 1] += 1;
                        }
                    }
                }
            }
            
            printf("%d.", sum[0]);
            for (i = 1; i <= r; i++){
                printf("%d", sum[i]);
            }
        }
        printf("\n");
    }
    
    return (0);
}

Compiler output:
main.c: In function 'main':
main.c:8:5: error: unknown type name '__int64'; did you mean '__int64_t'?
    8 |     __int64 syou, amari;
      |     ^~~~~~~
      |     __int64_t
Language: C++

#include <istream>
using namespace std;
int main(){
	int n,m,r;
	char *s="%.0lf\n";
	while(cin>>n>>r>>m>>r,n){
		double k=1;
		if(m) for(m=n;--m;)k+=(double)1/m;
		s[2]='0'+r;
		printf(s,k/n);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
    5 |         char *s="%.0lf\n";
      |                 ^~~~~~~~~
a.cc:6:15: error: 'cin' was not declared in this scope
    6 |         while(cin>>n>>r>>m>>r,n){
      |               ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <istream>
  +++ |+#include <iostream>
    2 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
int main(){
	int n,m,r,t;
	char s[10];
	strcpy(s,"%.0lf\n");
	while(cin>>n>>t>>m>>r,n){
		double k=1;
		if(m) for(m=n;--m;)k+=(double)1/m;
		s[2]='0'+r;
		printf(s,k/n);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'strcpy' was not declared in this scope
    6 |         strcpy(s,"%.0lf\n");
      |         ^~~~~~
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 | using namespace std;
Language: C++

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

const int MAX_R = 10000;
const int MAX_N = 10000;
const int MAX_K = 100;

int n, k, m, r;
int rest[MAX_N+1];
vector<int> num;
vector<int> use;
int trial;
int success;

bool is_success() {
	bool ret = true;
	for(int i=1; i<=n; i++) {
		if(rest[i] != 0) {
			ret = false;
			break;
		}
	}
	return ret;
}

int get() {
	for(int i=1; i<=n; i++) {
		if(rest[i] != 0) {
			return i;
		}
	}
	return -1;
}

void solve() {
	for(int i=0; i<num.size(); i++) {
		if(use[i]) continue;
		// printf("num=%d\n", num[i]);
		if(rest[num[i]] > 0) {
			// printf("proceed\n");
			rest[num[i]]--;
			use[i] = 1;
			solve();
			rest[num[i]]++;
			use[i] = 0;
		} else if(is_success()) {
			// printf("success\n");
			success++;
			trial++;
		} else if(m > 0) {
			// printf("retry\n");
			int j = get();
			rest[j]--;
			use[i] = 1;
			m--;
			solve();
			rest[j]++;
			use[i] = 0;
			m++;
		} else {
			// printf("false\n");
			trial++;
		}
	}
}

int main() {
	while( 1 ) {
		cin >> n >> k >> m >> r;
		if(!(n | k | m | r)) break;

		memset(rest, 0, sizeof(int)*MAX_K);
		use = vector<int>(n * k);
		memset(&use[0], 0, sizeof(int)*n*k);
		num.clear();
		for(int i=0; i<n; i++) {
			for(int j=0; j<k; j++) {
				num.push_back(i+1);
			}
			rest[i+1] = k;
		}

		rest[1]--;
		trial = 0;
		success = 0;
		solve();
		// printf("trial=%d, success=%d\n", trial, success);
		printf("%f\n", (double)success / (double)trial);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:17: error: 'memset' was not declared in this scope
   73 |                 memset(rest, 0, sizeof(int)*MAX_K);
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#inlucde <cstdio>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <cstring>
using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,s,e) for(int i=s; i<=e; i++)
#define repd(i,s,e) for(int i=s; i>=e; i--)

const int R_MAX = 100011;
int n, k, m, r;
int ans[R_MAX];

void add(int d) {
	ans[0] += 1 / d;
	int res = 1 % d;
	repa(i,1,r+10) {
		res *= 10;
		ans[i] += res / d;
		if(res % d == 0) break;
		res = res % d;
	}

	repd(i,r+10,0) {
		if(ans[i] >= 10) {
			int u = ans[i] / 10;
			ans[i] = ans[i] % 10;
			ans[i-1] += u;
		}
	}
}

void div(int d) {
	int res = 0;
	rep(i,r+10) {
		res += ans[i];
		ans[i] = res / d;
		res = res % d;
		res *= 10;
	}
}

int main() {
	while(cin>>n>>k>>m>>r, n|k|m|r) {
		memset(ans, 0, sizeof(int) * R_MAX);
		if(m == 0) {
			add(n);
		} else {
			repa(i,1,n-1) {
				add(i);
			}
			div(n);
			add(n);
		}

		printf("%d.", ans[0]);
		repa(i,1,r) printf("%d", ans[i]);
		printf("\n");
	}
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlucde; did you mean #include?
    1 | #inlucde <cstdio>
      |  ^~~~~~~
      |  include
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        for (;;) {
            int m = sc.nextInt(), n = sc.nextInt();
            if ((m | n) == 0) {
                break;
            }
            int[] r = new int[n];
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < n; j++)
                    r[j] += sc.nextInt();
            }
            int[] t = r.clone();
            Arrays.sort(r);
            for (int i = n - 1; i >= 0; i--) {
                for (int j = 0; j < n; j++) {
                    if (r[i] == t[j]) {
                        System.out.print((j + 1) + (i > 0 ? " " : "\n"));
                        t[j]=-1;
                    }
                }
            }
        }
    }
}


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

#include<stdio.h>
 
int main()
{
    int n,m,i,j,max;
    int k[1000][100];
    int sum[100];
 
    while(scanf("%d%d",&n,&m),n+m){
      
      for(i=0;i<n;i++){
        for(j=0;j<m;j++){
          scanf("%d",&k[i][j]);
      }
      for(i=0;i<100;i++) sum[i]=0;
      
      for(j=0;j<m;j++){
        for(i=0;i<n;i++){
          sum[j]+=k[i][j];
        }
      }
      
      for(i=0;i<m;i++){
        for(j=n;j>=0;j++){
          if(sum[i]==j) printf("%d",i);
        }
      }
          
      printf("\n");
    }   
    return 0;
}

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

#include <stdio.h>

int a,b,c[1000][1000],d[1000][2],e,i,j;

int main(){
	
	while(1){
		scanf("%d %d",&a,&b);
		if(a==0&&b==0){
			return 0;
		}
		for(i=0;i<a;i++){
			for(j=0;j<b;j++){
				scanf("%d",&c[i][j]);
			}
		}
		for(j=0;j<b;j++){
			d[j][0]=0;
			d[j][1]=j;
			for(i=0;i<a;i++){
			d[j][0]+=c[i][j];
			}
		}
		for(j=0;j<b;j++){
			for(i=0;i<b-1;i++){
				if(d[i][0]>d[i+1][0]){
					e=d[i][0];
					d[i][0]=d[i+1][0];
					d[i+1][0]=e;
					e=d[i][1];
					d[i][1]=d[i+1][1];
					d[i+1][1]=e;
				}
				if(d[i][0]==d[i+1][0]){
					if(d[i][1]<d[i+1][1]){
						e=d[i][1];
						d[i][1]=d[i+1][1];
						d[i+1][1]=e;
					}
				}
			}
		}
		for(i=b-1;i>0;i--){
			printf("%d ",d[i][1]+1);
		}
		
		printf("%d\n"d[0][1]+1);
	}
}

Compiler output:
main.c: In function 'main':
main.c:47:30: error: expected ')' before 'd'
   47 |                 printf("%d\n"d[0][1]+1);
      |                       ~      ^
      |                              )
Language: C

    if(n==0&&m==0)break;
    for(i=0;i<100;i++){
      b[i]=0;
      a[i]=i+1;    
    
    } 

Compiler output:
main.c:1:5: error: expected identifier or '(' before 'if'
    1 |     if(n==0&&m==0)break;
      |     ^~
main.c:2:5: error: expected identifier or '(' before 'for'
    2 |     for(i=0;i<100;i++){
      |     ^~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 |     for(i=0;i<100;i++){
      |              ^
main.c:2:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    2 |     for(i=0;i<100;i++){
      |                    ^~
Language: C

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

typedef struct {
	int no;
	int num;
} place_t;

int comp(const void* x,const void* y) {
	place_t* a=(place_t*)x;
	place_t* b=(place_t*)y;
	if(a.num>b.num)return 1;
	if(a.num<b.num)return -1;
	if(a.no>b.no)return 1;
	if(a.no<b.no)return -1;
	return 0;
}

int main(void) {
	place_t place[100];
	int i,j,n,m;
	int one;
	while(1) {
		scanf("%d %d",&n,&m);
		if(n==0 && m==0)break;
		for(i=0;i<100;i++) {
			place[i].no=i;
			place[i].num=0;
		for(i=0;i<n;i++) {
			for(j=0;j<m;j++) {
				scanf("%d",&one);
				if(one)place[j].num++;
			}
		}
		qsort(place,m,sizeof(place_t),comp);
		for(i=0;i<m-1;i++) {
			printf("%d ",place[i].no+1);
		}
		printf("%d\n".place[m-1].no+1);
	}
	return 0;
}

Compiler output:
main.c: In function 'comp':
main.c:12:13: error: 'a' is a pointer; did you mean to use '->'?
   12 |         if(a.num>b.num)return 1;
      |             ^
      |             ->
main.c:12:19: error: 'b' is a pointer; did you mean to use '->'?
   12 |         if(a.num>b.num)return 1;
      |                   ^
      |                   ->
main.c:13:13: error: 'a' is a pointer; did you mean to use '->'?
   13 |         if(a.num<b.num)return -1;
      |             ^
      |             ->
main.c:13:19: error: 'b' is a pointer; did you mean to use '->'?
   13 |         if(a.num<b.num)return -1;
      |                   ^
      |                   ->
main.c:14:13: error: 'a' is a pointer; did you mean to use '->'?
   14 |         if(a.no>b.no)return 1;
      |             ^
      |             ->
main.c:14:18: error: 'b' is a pointer; did you mean to use '->'?
   14 |         if(a.no>b.no)return 1;
      |                  ^
      |                  ->
main.c:15:13: error: 'a' is a pointer; did you mean to use '->'?
   15 |         if(a.no<b.no)return -1;
      |             ^
      |             ->
main.c:15:18: error: 'b' is a pointer; did you mean to use '->'?
   15 |         if(a.no<b.no)return -1;
      |                  ^
      |                  ->
main.c: In function 'main':
main.c:39:30: error: request for member 'place' in something not a structure or union
   39 |                 printf("%d\n".place[m-1].no+1);
      |                              ^
main.c:42:1: error: expected declaration or statement at end of input
   42 | }
      | ^
Language: C

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

typedef struct {
	int no;
	int num;
} place_t;

int comp(const void* x,const void* y) {
	place_t* a=(place_t*)x;
	place_t* b=(place_t*)y;
	if(a->num>b->num)return 1;
	if(a->num<b->num)return -1;
	if(a->no>b->no)return 1;
	if(a->no<b->no)return -1;
	return 0;
}

int main(void) {
	place_t place[100];
	int i,j,n,m;
	int one;
	while(1) {
		scanf("%d %d",&n,&m);
		if(n==0 && m==0)break;
		for(i=0;i<100;i++) {
			place[i].no=i;
			place[i].num=0;
		for(i=0;i<n;i++) {
			for(j=0;j<m;j++) {
				scanf("%d",&one);
				if(one)place[j].num++;
			}
		}
		qsort(place,m,sizeof(place_t),comp);
		for(i=0;i<m-1;i++) {
			printf("%d ",place[i].no+1);
		}
		printf("%d\n",place[m-1].no+1);
	}
	return 0;
}

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

#include<stdio.h>   int main(void){   int p[100],rank[100];   int n,m;   int i,j;   int tmp;     while(1){     scanf("%d %d ",&n,&m);     if(!n && !m)break;       for(i=0;i<m;i++){       p[i] = 0;       rank[i] = i;     }           for(i=0;i<n;i++){       for(j=0;j<m;j++){     scanf("%d ",&tmp);         p[j] += tmp;       }     }       for(i=0;i<m-1;i++){       for(j=i+1;j<m;j++){     if(p[rank[i]]<p[rank[j]]){       tmp = rank[i];       rank[i] = rank[j];       rank[j] = tmp;     }     if(p[rank[i]]==p[rank[j]]){       if(rank[i]>rank[j]){         tmp = rank[i];         rank[i] = rank[j];         rank[j] = tmp;       }     }       }     }       for(i=0;i<m;i++){       printf("%d",rank[i]+1);       if(i!=m-1)putchar(' ');     }     putchar('n');   }     return 0; } 

Compiler output:
main.c:1:21: warning: extra tokens at end of #include directive
    1 | #include<stdio.h>   int main(void){   int p[100],rank[100];   int n,m;   int i,j;   int tmp;     while(1){     scanf("%d %d ",&n,&m);     if(!n && !m)break;       for(i=0;i<m;i++){       p[i] = 0;       rank[i] = i;     }           for(i=0;i<n;i++){       for(j=0;j<m;j++){     scanf("%d ",&tmp);         p[j] += tmp;       }     }       for(i=0;i<m-1;i++){       for(j=i+1;j<m;j++){     if(p[rank[i]]<p[rank[j]]){       tmp = rank[i];       rank[i] = rank[j];       rank[j] = tmp;     }     if(p[rank[i]]==p[rank[j]]){       if(rank[i]>rank[j]){         tmp = rank[i];         rank[i] = rank[j];         rank[j] = tmp;       }     }       }     }       for(i=0;i<m;i++){       printf("%d",rank[i]+1);       if(i!=m-1)putchar(' ');     }     putchar('n');   }     return 0; }
      |                     ^~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  while(1){
    int n, m, results[100], i ,j;
    memset(rusults, 0, sizeof(results));
    scanf("%d%d", &n, &m);
    if(n == 0 && m == 0)return 0;
    for(i = 0;i < n;i++){
      for(j = 0;j < m;j++){
        int k;
        scanf("%d", &k);
        results[j] += k;
      }
    }
    for(i = 0;i < 100;i++){
      for(j = 0;j < m;j++){
        if(results[j] == i){
          printf("%d ",j + 1);
        }
      }
    }
    puts("");
  }
}

Compiler output:
main.c: In function 'main':
main.c:6:12: error: 'rusults' undeclared (first use in this function); did you mean 'results'?
    6 |     memset(rusults, 0, sizeof(results));
      |            ^~~~~~~
      |            results
main.c:6:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
	int i,j,n,m,result[100],h,rank[100];
	for(i=0; i<100; i++){
		result[i]=0;
		rank[i]=0;
	}
	scanf(“%d%d”,&n,&m);
	for(i=0; i<n; i++){
		for(j=0; j<m; j++){
			scanf(“%d”,&h);
			result[j]+=h;
		}
	}
	for(i=0; i<m; i++){
		j=0;
		for(j=0; j<m; j++){
			if(result[i]<result[j]){
				j++;
			}
		}
		while(rank[j]!=0){
			j++;
		}
		rank[j]=(i+1);
	}
	for(i=0; i<m; i++){
		if(i==(m-1)){
			printf(“%d ”,rank[i]);
		}else{
			printf(“%d\n”,rank[i]);
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:15: error: stray '\342' in program
    8 |         scanf(<U+201C>%d%d<U+201D>,&n,&m);
      |               ^~~~~~~~
main.c:8:16: error: expected expression before '%' token
    8 |         scanf(“%d%d”,&n,&m);
      |                ^
main.c:8:20: error: stray '\342' in program
    8 |         scanf(<U+201C>%d%d<U+201D>,&n,&m);
      |                           ^~~~~~~~
main.c:11:31: error: stray '\342' in program
   11 |                         scanf(<U+201C>%d<U+201D>,&h);
      |                               ^~~~~~~~
main.c:11:32: error: expected expression before '%' token
   11 |                         scanf(“%d”,&h);
      |                                ^
main.c:11:34: error: stray '\342' in program
   11 |                         scanf(<U+201C>%d<U+201D>,&h);
      |                                         ^~~~~~~~
main.c:29:32: error: stray '\342' in program
   29 |                         printf(<U+201C>%d <U+201D>,rank[i]);
      |                                ^~~~~~~~
main.c:29:33: error: expected expression before '%' token
   29 |                         printf(“%d ”,rank[i]);
      |                                 ^
main.c:29:36: error: stray '\342' in program
   29 |                         printf(<U+201C>%d <U+201D>,rank[i]);
      |                                           ^~~~~~~~
main.c:31:32: error: stray '\342' in program
   31 |                         printf(<U+201C>%d\n<U+201D>,rank[i]);
      |                                ^~~~~~~~
main.c:31:33: error: expected expression before '%' token
   31 |                         printf(“%d\n”,rank[i]);
      |                                 ^
main.c:31:35: error: stray '\' in program
   31 |                         printf(“%d\n”,rank[i]);
      |                                   ^
main.c:31:37: error: stray '\342' in program
   31 |                         printf(<U+201C>%d\n<U+201D>,rank[i]);
      |                                            ^~~~~~~~
Language: C

#include <stdio.h>
int main(void){
	int i,j,n,m,result[100],h,rank[100];
	for(i=0; i<100; i++){
		result[i]=0;
		rank[i]=0;
	}
	scanf(“%d%d”,&n,&m);
	for(i=0; i<n; i++){
		for(j=0; j<m; j++){
			scanf(“%d”,&h);
			result[j]+=h;
		}
	}
	for(i=0; i<m; i++){
		j=0;
		for(j=0; j<m; j++){
			if(result[i]<result[j]){
		}
		while(rank[j]!=0){
			j++;
		}
		rank[j]=(i+1);
	}
	for(i=0; i<m; i++){
		if(i==(m-1)){
			printf(“%d ”,rank[i]);
		}else{
			printf(“%d\n”,rank[i]);
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:15: error: stray '\342' in program
    8 |         scanf(<U+201C>%d%d<U+201D>,&n,&m);
      |               ^~~~~~~~
main.c:8:16: error: expected expression before '%' token
    8 |         scanf(“%d%d”,&n,&m);
      |                ^
main.c:8:20: error: stray '\342' in program
    8 |         scanf(<U+201C>%d%d<U+201D>,&n,&m);
      |                           ^~~~~~~~
main.c:11:31: error: stray '\342' in program
   11 |                         scanf(<U+201C>%d<U+201D>,&h);
      |                               ^~~~~~~~
main.c:11:32: error: expected expression before '%' token
   11 |                         scanf(“%d”,&h);
      |                                ^
main.c:11:34: error: stray '\342' in program
   11 |                         scanf(<U+201C>%d<U+201D>,&h);
      |                                         ^~~~~~~~
main.c:27:32: error: stray '\342' in program
   27 |                         printf(<U+201C>%d <U+201D>,rank[i]);
      |                                ^~~~~~~~
main.c:27:33: error: expected expression before '%' token
   27 |                         printf(“%d ”,rank[i]);
      |                                 ^
main.c:27:36: error: stray '\342' in program
   27 |                         printf(<U+201C>%d <U+201D>,rank[i]);
      |                                           ^~~~~~~~
main.c:29:32: error: stray '\342' in program
   29 |                         printf(<U+201C>%d\n<U+201D>,rank[i]);
      |                                ^~~~~~~~
main.c:29:33: error: expected expression before '%' token
   29 |                         printf(“%d\n”,rank[i]);
      |                                 ^
main.c:29:35: error: stray '\' in program
   29 |                         printf(“%d\n”,rank[i]);
      |                                   ^
main.c:29:37: error: stray '\342' in program
   29 |                         printf(<U+201C>%d\n<U+201D>,rank[i]);
      |                                            ^~~~~~~~
main.c:33:1: error: expected declaration or statement at end of input
   33 | }
      | ^
Language: C

#include <stdio.h>
int main(void){
	int i,j,n,m,result[100],h,rank[100];
	for(i=0; i<100; i++){
		result[i]=0;
		rank[i]=0;
	}
	scanf("%d%d",&n,&m);
	for(i=0; i<n; i++){
		for(j=0; j<m; j++){
			scanf("%d",&h);
			result[j]+=h;
		}
	}
	for(i=0; i<m; i++){
		j=0;
		for(j=0; j<m; j++){
			if(result[i]<result[j]){
		}
		while(rank[j]!=0){
			j++;
		}
		rank[j]=(i+1);
	}
	for(i=0; i<m; i++){
		if(i==(m-1)){
			printf("%d ",rank[i]);
		}else{
			printf("%d\n",rank[i]);
		}
	}
	return 0;
}

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

#include <stdio.h>
int main(void){
    int i,j,n,m,result[100],h,rank[100];
    scanf("%d%d",&n,&m);
    while(n!=0 || m!=0){
    for(i=0; i<100; i++){
        result[i]=0;
        rank[i]=0;
    }
    for(i=0; i<n; i++){
        for(j=0; j<m; j++){
            scanf("%d",&h);
            result[j]+=h;
        }
    }
    for(i=0; i<m; i++){
        j=0;
        for(j=0; j<m; j++){
            if(result[i]<result[j]){
        }
        while(rank[j]!=0){
            j++;
        }
        rank[j]=(i+1);
    }
    for(i=0; i<m; i++){
        if(i==(m-1)){
            printf("%d ",rank[i]);
        }else{
            printf("%d\n",rank[i]);
        }
    }
    scanf("%d%d",&n,&m);
    }
    return 0;
}

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

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

int main()
{
	while (1)
	{
		int n, m;

		cin >> n >> m;
		if (n == 0 && M == 0)break;
		int su[1200] = {}, hage[1200] = {};
		for (int i = 0; i < n; i++)
		{
			for (int s = 0; s < m; s++)
			{
				int q;
				cin >> q;
				su[s] += q;
				hage[s] += q;
			}
		}
		sort(su, su + m);
		for (int i = 0; i < m; i++)
		{
			for (int c = m - 1; c != -1; c--)
			{
				if (su[c] == hage[i]){
					su[c] = 1500;
					cout << 7 - (c + 1) << " ";
					break;
				}
			}
		}

		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: 'M' was not declared in this scope
   13 |                 if (n == 0 && M == 0)break;
      |                               ^
Language: C++

#include <utility>
#include <algorithm>
#include <iostream>
using namespace std;
int main(){
  int N, M, v;
  pair<int,int> vote_area[110];
  while (cin >> N >> M && N>0) {
    //ペアの初期化
    for (int j = 0; j < M; ++i)
    {
      vote_area[j].first = 0;
      vote_area[j].second = j+1;/* code */
    }

    for (int i = 0; i < N; ++i)
    {
      for (int j = 0; j < M; ++i)
      {
        cin >> v;/* i人目の人が場所jに行きたいかどうか */
        if (v==1)
        {
          vote_area[j].first += 1;
        }
      }
    }

//あるタイミングで整列する
    reverse(vote_area, vote_area+M);
    for (int i = 0; i < M; ++i)
    {
      cout << vote_area[i].second;
    }
    cout << endl;

  }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: 'i' was not declared in this scope
   10 |     for (int j = 0; j < M; ++i)
      |                              ^
Language: C++

#include <utility>
#include <algorithm>
#include <iostream>
using namespace std;
int main(){
  int N, M, v;
  pair<int,int> vote_area[110];
  while (cin >> N >> M && M >0) {
    //ペアの初期化
    for (int j = 0; j < M; ++j)
    {
      vote_area[j].first = 0;
      vote_area[j].second = j+1;/* code */
    }

    for (int i = 0; i < N; ++i)
    {
      for (int j = 0; j < M; ++j)
      {
        cin >> v;/* i人目の人が場所jに行きたいかどうか */  
        vote_area[j].first -= v;
        // cout << vote_area[j].first;
      }
      // cout << endl;
    }

//あるタイミングで整列する
    sort(vote_area, vote_area+M);
    // reverse(vote_area, vote_area+M);
    for (int i = 0; i < M; ++i)
    {
      cout << vote_area[i].second;
      if (i<M-1)
      {
        cout << " "
      }
    }
    cout << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:20: error: expected ';' before '}' token
   35 |         cout << " "
      |                    ^
      |                    ;
   36 |       }
      |       ~
Language: C++

#include <iostream>
#include <vector>
#include <utility>
using namespace std;

typedef pair<int, int> pii;

bool greaterP(pii lhs, pii rhs) {
    if (lhs.first != rhs.first) {
        return lhs.first > rhs.first;
    } else {
        return lhs.second < rhs.second;
    }
}

int main(void) {
    int n, m;

    while (cin >> n >> m, n+m) {
        vector<pii> Q(m);
        for (int i = 0; i < m; i++) {
            Q[i].first = 0;
            Q[i].second = i+1;
        }
        int q;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                cin >> q;
                if (q) {
                    Q[j].first++;
                }
            }
        }

        sort(Q.begin(), Q.end(), greaterP);

        cout << Q[0].second;
        for (int i = 1; i < m; i++) {
            cout << " " << Q[i].second;
        }
        cout << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   35 |         sort(Q.begin(), Q.end(), greaterP);
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <vector>
#include <map>
using namespace std;

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

  int n,m;
  while(cin >> n >> m) {
    if((n|m) == 0) break;

    int a[n][m];
    for(int i=0;i<n;i++) {
      for(int j=0;j<m;j++) {
        cin >> a[i][j];
      }
    }
    vector< pair<int,int> > q_res;
    for(int j=0;j<m;j++) {
      int place_id = j+1;
      int popular = 0;
      for(int i=0;i<n;i++) {
        if(a[i][j]==1)
          popular++;
      }
      q_res.push_back(make_pair(-popular,place_id));
    }

    sort(q_res.begin(),q_res.end());

    for(int j=0;j<m;j++) {
      cout << q_res[j].second << (j+1 == m ? "\n" : " ");
    }
    q_res.clear();

  } // end while
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   31 |     sort(q_res.begin(),q_res.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>


bool comp(const std::pair<int, int>& firstElem, const std::pair<int, int>& secondElem) {
  return firstElem.second > secondElem.second;
}

int main() {
  int n, m;
  int temp;
  while(1) {
    std::cin >> n >> m;
    if (n == 0 && m == 0) break;
    std::pair<int, int> sums[100]; 

    for (int j = 0; j < m; j ++)
      sums[j].first = j + 1;

    for (int i = 0; i < n; i ++) for (int j = 0; j < m; j ++) {
        std::cin >> temp;
        sums[j].second += temp;
    }

    std::sort(std::begin(sums), std::end(sums), comp);

    int k = 0;
    while (1) {
      std::cout << sums[k ++].first;;
      if (k != m) std::cout << " ";
      else break;
    }
    std::cout << std::endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   24 |     std::sort(std::begin(sums), std::end(sums), comp);
      |          ^~~~
      |          qsort
Language: C++

using System;
using System.Linq;
 
namespace aizu
{
    public class OnlineJudge
    {
        static void Main()
        {
            int[] input;
            while(((input = Console.ReadLine().Split().Select(p => int.Parse(p)).ToArray())[0] | input[1]) != 0) {
                var data = (from p in Enumerable.Range(1, input[0]) let d = Console.ReadLine().Split().Select(b => b == "1").ToArray() select (Enumerable.Range(1, input[1]).Select(q => new { k = q, v = d[q - 1] })).ToDictionary(q => q.k, q => q.v)).ToArray();
                Console.WriteLine(string.Join(" ", Enumerable.Range(1, input[1]).OrderByDescending(p => data.Count(q => q[p] == true)).ThenBy(p => p).Select(q => q.ToString()).ToArray()));
            }
        }
    }
}

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

#include <iostream>
#include <vector>
#include <utility>

bool compare(std::pair<int,int> x, std::pair<int,int> y){
    return (x.first != y.first) ? x.first > y.first : x.second < y.second;
}

int n = 0, m = 0;
int main(void){
    int i = 0;
    int j = 0;
    std::vector< std::pair<int,int> > votes;

    int v = 0;
    while(std::cin >> n >> m){
        if(n==0 && m ==0) break;

        votes.resize(m);
        votes.clear();

        for(i=0; i<m; ++i){
            votes[i].first = 0;
            votes[i].second = i+1;
        }

        for(i=0; i<n; ++i){
            for(j=0; j<m; ++j){
                std::cin >> v;
                if(v == 1){
                    votes[j].first += 1;
                }
            }
        }

        std::sort(votes.begin(), votes.begin() + m, compare);
        for(i=0; i<m; ++i){
            std::cout << (i==0 ? "" : " ") << votes[i].second;
        }
        std::cout << std::endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   36 |         std::sort(votes.begin(), votes.begin() + m, compare);
      |              ^~~~
      |              qsort
Language: C++

#include<bits\stdc++.h>
using namespace std;
int main(void){
	int n,m,cnt[101],b[101],i,j,temp,a;
	while(1){
		cin>>n>>m;
		if(n==0&&m==0)break;
		for(i=1;i<=m;i++) cnt[i]=0,b[i]=i;
		for(i=0;i<n;i++){
			for(j=1;j<=m;j++){
				cin>>a;
				if(a==1) cnt[j]++;
			}
		}
		for(i=1;i<m;i++){
			for(j=i+1;j<=m;j++){
				if(cnt[i]<cnt[j]){
					temp=cnt[i]; cnt[i]=cnt[j]; cnt[j]=temp;
					temp=b[i]; b[i]=b[j]; b[j]=temp;
				}
			}
		}
		for(i=1;i<m;i++) cout<<b[i]<<' ';
		cout<<b[m]<<endl;
	}
	return 0;
}

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

#include<iostream>
#include<vector>

using namespace std;

int n, m;
int my_find(int val, int res[])
{
	for(int i = 0; i < m; i++){
		if(res[i] == val){
			return i;
		}
	}
	return 0;
}

int main()
{
	int g, gab;
	int ank[1000][100];
	int max, place;
	
	for(;;){
		cin >> n;
		cin >> m;
		if(n == 0 && m == 0){
			break;
		}
		
		vector<int> result_sort(m, 0);
		vector<int> result(m, 0);
		
		for(int i = 0; i < n; i++){
			for(int j = 0; j < m; j++){
				cin  >> ank[i][j];
			}
		}
		
		for(int i = 0; i < m; i++){
			for(int j = 0; j < n; j++){
				result[i] += ank[j][i];
			}
		}
		
		g = 0;
		
		for(int i = 0; i < m; i++){
			max = *max_element(result.begin(), result.end());		//±Ì_ÅÌÅålðo
			place = my_find(max, result.begin());
			result_sort[i] = place;									//êðãü
			result[place] = 0;										//ÅålÌ Á½êð0Å«·¦é
		}
		
		for(int i = 0; i < m; i++){
			cout << result_sort[i]+1;
		}
	}
			
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:32: error: 'max_element' was not declared in this scope
   48 |                         max = *max_element(result.begin(), result.end());               //±Ì_ÅÌÅålðo
      |                                ^~~~~~~~~~~
a.cc:49:58: error: cannot convert 'std::vector<int>::iterator' to 'int*'
   49 |                         place = my_find(max, result.begin());
      |                                              ~~~~~~~~~~~~^~
      |                                                          |
      |                                                          std::vector<int>::iterator
a.cc:7:26: note:   initializing argument 2 of 'int my_find(int, int*)'
    7 | int my_find(int val, int res[])
      |                      ~~~~^~~~~
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int n, m;
int my_find(int val, int res[])
{
	for(int i = 0; i < m; i++){
		if(res[i] == val){
			return i;
		}
	}
	return 0;
}

int main()
{
	int ank[1000][100];
	int max, place;
	
	for(;;){
		cin >> n;
		cin >> m;
		if(n == 0 && m == 0){
			break;
		}
		
		vector<int> result_sort(m, 0);
		vector<int> result(m, 0);
		
		for(int i = 0; i < n; i++){
			for(int j = 0; j < m; j++){
				cin  >> ank[i][j];
			}
		}
		
		for(int i = 0; i < m; i++){
			for(int j = 0; j < n; j++){
				result[i] += ank[j][i];
			}
		}
		
		for(int i = 0; i < m; i++){
			max = *max_element(result.begin(), result.end());		//±Ì_ÅÌÅålðo
			place = my_find(max, result.begin());
			result_sort[i] = place;									//êðãü
			result[place] = 0;										//ÅålÌ Á½êð0Å«·¦é
		}
		
		for(int i = 0; i < m; i++){
			cout << result_sort[i]+1;
		}
		printf("\n");
	}
			
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:32: error: 'max_element' was not declared in this scope
   45 |                         max = *max_element(result.begin(), result.end());               //±Ì_ÅÌÅålðo
      |                                ^~~~~~~~~~~
a.cc:46:58: error: cannot convert 'std::vector<int>::iterator' to 'int*'
   46 |                         place = my_find(max, result.begin());
      |                                              ~~~~~~~~~~~~^~
      |                                                          |
      |                                                          std::vector<int>::iterator
a.cc:7:26: note:   initializing argument 2 of 'int my_find(int, int*)'
    7 | int my_find(int val, int res[])
      |                      ~~~~^~~~~
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int n, m;
int my_find(int val, int res[])
{
	for(int i = 0; i < m; i++){
		if(res[i] == val){
			return i;
		}
	}
	return 0;
}

int main()
{
	int ank[1000][100];
	int max, place;
	vector<int> result_sort(m, 0);
	vector<int> result(m, 0);
	
	for(;;){
		cin >> n;
		cin >> m;
		if(n == 0 && m == 0){
			break;
		}
		
		for(int i = 0; i < n; i++){
			for(int j = 0; j < m; j++){
				cin  >> ank[i][j];
			}
		}
		
		for(int i = 0; i < m; i++){
			for(int j = 0; j < n; j++){
				result[i] += ank[j][i];
			}
		}
		
		for(int i = 0; i < m; i++){
			max = *max_element(result.begin(), result.end());		//±Ì_ÅÌÅålðo
			place = my_find(max, result.begin());
			result_sort[i] = place;									//êðãü
			result[place] = 0;										//ÅålÌ Á½êð0Å«·¦é
		}
		
		for(int i = 0; i < m; i++){
			cout << result_sort[i]+1;
		}
		printf("\n");
	}
			
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:32: error: 'max_element' was not declared in this scope
   44 |                         max = *max_element(result.begin(), result.end());               //±Ì_ÅÌÅålðo
      |                                ^~~~~~~~~~~
a.cc:45:58: error: cannot convert 'std::vector<int>::iterator' to 'int*'
   45 |                         place = my_find(max, result.begin());
      |                                              ~~~~~~~~~~~~^~
      |                                                          |
      |                                                          std::vector<int>::iterator
a.cc:7:26: note:   initializing argument 2 of 'int my_find(int, int*)'
    7 | int my_find(int val, int res[])
      |                      ~~~~^~~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int n, m;
int my_find(int val, int res[])
{
	for(int i = 0; i < m; i++){
		if(res[i] == val){
			return i;
		}
	}
	return 0;
}

int main()
{
	int ank[1000][100];
	int max, place;
	vector<int> result_sort(m, 0);
	vector<int> result(m, 0);
	
	for(;;){
		cin >> n;
		cin >> m;
		if(n == 0 && m == 0){
			break;
		}
		
		for(int i = 0; i < n; i++){
			for(int j = 0; j < m; j++){
				cin  >> ank[i][j];
			}
		}
		
		for(int i = 0; i < m; i++){
			for(int j = 0; j < n; j++){
				result[i] += ank[j][i];
			}
		}
		
		for(int i = 0; i < m; i++){
			max = *max_element(result.begin(), result.end());		//±Ì_ÅÌÅålðo
			place = my_find(max, result.begin());
			result_sort[i] = place;									//êðãü
			result[place] = 0;										//ÅålÌ Á½êð0Å«·¦é
		}
		
		for(int i = 0; i < m; i++){
			cout << result_sort[i]+1;
		}
		printf("\n");
	}
			
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:58: error: cannot convert 'std::vector<int>::iterator' to 'int*'
   46 |                         place = my_find(max, result.begin());
      |                                              ~~~~~~~~~~~~^~
      |                                                          |
      |                                                          std::vector<int>::iterator
a.cc:8:26: note:   initializing argument 2 of 'int my_find(int, int*)'
    8 | int my_find(int val, int res[])
      |                      ~~~~^~~~~
Language: C++

#include<cstdio>
#include<cstdlib>

int main(){
  int a,b,d;
  FILE *fp,*fq;
  fp=fopen("input.txt","r");
  while(1){
    fscanf(fp,"%d%d",&a,&b);
    if(a==0) break;
    int as[b];
    for(int j=0;j<a;j++)
      for(int i=0;i<b;i++)
       {
	fscanf(fp,"%d",d);
	if(d) as[b]++;
       }
  }
  for(int i=0;i<b-1;i++)
    {
      for(int j=i+1;j<b;j++)
	if(as[i]<as[j]){
	  d=as[i];
	  as[i]=as[j];
	  as[j]=d;
	}
    }
  fq=fopen("output.txt","w");
  for(int i=0;i<b;i++)
    fprintf(fq,"%d ",as[i]);
  fprintf(fq,"\n");
}
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:12: error: 'as' was not declared in this scope; did you mean 'a'?
   22 |         if(as[i]<as[j]){
      |            ^~
      |            a
a.cc:30:22: error: 'as' was not declared in this scope; did you mean 'a'?
   30 |     fprintf(fq,"%d ",as[i]);
      |                      ^~
      |                      a
a.cc: At global scope:
a.cc:34:3: error: expected unqualified-id before 'return'
   34 |   return 0;
      |   ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

#include<stdio.h>

typedef struct tagDATA
{
	int num;
	int cnt;
} DATA;

int cmp(const void* a,const void* b);

int cmp(const void* a,const void* b)
{
	return (((DATA*)a)->cnt)-(((DATA*)b)->cnt);
}

int main(){
	int n,m,i,j,t;
	DATA dat[100];
	FILE *ip,*op;
	freopen("input.txt","r",ip);
	freopen("output.txt","a+",op);
	while(1)
	{
		scanf("%d%d",&n,&m);
		if(n==0&&m==0)break;
		for(j=0;j<m;j++)
		{
			dat[j].num=j+1;
			dat[j].cnt=0;
		}
		for(i=0;i<n;i++)
		{
			for(j=0;j<m;j++)
			{
				scanf("%d",&t);
				if(t)dat[j].cnt++;
			}
		}
		qsort(&dat,m,sizeof(DATA),cmp);
		for(j=0;j<m;j++)
		{
			printf("%d ",dat[j].num);
		}
		printf("\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: 'qsort' was not declared in this scope
   39 |                 qsort(&dat,m,sizeof(DATA),cmp);
      |                 ^~~~~
Language: C++

#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <vector>

using namespace std;

int main(){

	int n,m;
	while(cin >> n >> m && !(n == 0 && m == 0)){
		vector<int> v(m,0);
		for(int i = 0; i < n; i++){
			for(int j = 0; j < m; j++){
				int p;
				cin >> p;
				if(p)
					v[j]++;
			}
		}
		vector<pair<int,int > > v2;
		for(int i = 0; i < v.size(); i++){
			v2.push_back(make_pair(v[i],-i));
		}

		sort(v2.begin(),v2.end(),greater<pair<int,int>ツ　>());
		for(int i = 0; i < v2.size(); i++){
			cout << -(v2[i].second-1) << " ";
		}
		cout << endl;
	}

	return 0;
}

Compiler output:
a.cc:27:63: error: extended character 　 is not valid in an identifier
   27 |                 sort(v2.begin(),v2.end(),greater<pair<int,int>ツ　>());
      |                                                               ^
a.cc: In function 'int main()':
a.cc:27:67: error: template argument 1 is invalid
   27 |                 sort(v2.begin(),v2.end(),greater<pair<int,int>ツ　>());
      |                                                                   ^
Language: C++

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

bool operator<( const pair<int,int> &l, const pair<int,int> &r ){
	return l.second < r.second;
}

int main(){
	int n, m;
	while( cin >> n >> m, n||m ){
		vector< pair<int, int> > res;
		res.resize(m);
		for( int i=0; i<m; i++ ){
			res[i].first = i+1;
			res[i].second = 0;
		}
		for( int i=0; i<n; i++ ){
			for( int j=0; j<m; j++ ){
				int k;
				cin >> k;
				if( k == 1 ){
					res[j].second++;
				}
			}
		}
		sort( res.rbegin(), res.rend() );
		cout << res[0];
		for( int i=1; i<m; i++ ){
			cout << " " << res[i].first;
		}
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'vector' was not declared in this scope
   13 |                 vector< pair<int, int> > res;
      |                 ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include<utility>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:13:40: error: expected primary-expression before '>' token
   13 |                 vector< pair<int, int> > res;
      |                                        ^
a.cc:13:42: error: 'res' was not declared in this scope
   13 |                 vector< pair<int, int> > res;
      |                                          ^~~
Language: C++

#include"functions.h"
int n,m;
int i,j;
int req[100],no[100];
int d;

void sort(int a[], int n,int b[]){
	int x;
	for(i=n-1;i>0;i--){
		for(j=0;j<i;j++){
			if(a[j]>a[j+1]){
				x=a[j];
				a[j]=a[j+1];
				a[j+1]=x;
				x=b[j];
				b[j]=b[j+1];
				b[j+1]=x;
			}
			else if(a[j]==a[j+1])if(b[j]<b[j+1]){
				x=b[j];
				b[j]=b[j+1];
				b[j+1]=x;
			}
		}
	}
}

int main(){
	while(1){
		scanf("%d %d",&n,&m);
		if(n==0&&m==0)return 0;
		for(i=0;i<m;i++)req[i]=0;
		for(i=0;i<m;i++)no[i]=i+1;
		for(i=0;i<n;i++)for(j=0;j<m;j++){
			scanf("%d",&d);
			if(d==1)req[j]++;
		}
		sort(req,m,no);
		for(i=m-1;i>=0;i--)printf("%d ",no[i]);
		printf("\n");
	}
}

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

#include<stdio.h>
int n,m;
int i,j;
int req[100],no[100];
int d;

void sort(int a[], int n,int b[]){
	int x;
	for(i=n-1;i>0;i--){
		for(j=0;j<i;j++){
			if(a[j]>a[j+1]){
				x=a[j];
				a[j]=a[j+1];
				a[j+1]=x;
				x=b[j];
				b[j]=b[j+1];
				b[j+1]=x;
			}
			else if(a[j]==a[j+1])if(b[j]<b[j+1]){
				x=b[j];
				b[j]=b[j+1];
				b[j+1]=x;
			}
		}
	}
}

int main(){
	while(1){
		scanf("%d %d",&n,&m);
		if(n==0&&m==0)return 0;
		for(i=0;i<m;i++)req[i]=0;
		for(i=0;i<m;i++)no[i]=i+1;
		for(i=0;i<n;i++)for(j=0;j<m;j++){
			scanf("%d",&d);
			if(d==1)req[j]++;
		}
		sort(req,m,no);
		for(i=m-1;i>=0;i--){
			printf("%d",no[i]);
			if(i!=0)printf(" ");
		printf("\n");
	}
}

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

#include<iostream>
using namespace std;

int main(){
int n,m,a,b;
int sum[100];
int big[100];
while(cin>>n>>m){
for(int i=0;i<100;i++){
sum[i]=0;}
b=0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
cin>>a;
sum[j]+=a;}}
for(int i=1000;i>-1;i--){
for(int j=0;j<m;j++){
if(i==sum[j]){
if(b!=m-1){
cout<<j+1<<" ";}
if(b==m-1){
cout<<j+1<<endl;}
b++;}}
}}

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