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

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


int card[50];
struct CUT{
  int p;
  int c;
};

CUT cut[51];
int swap_p[50];
int swap_c[50];
int n,r;
void solve(){
  for(int i = 0; i < n; i++){
    card[i] = n - i;
  }
/*
  for(int i = 0; i < r ; i++){
    for(int x = 0; x < n; x++){
      cout << card[x] << " ";
    }
    cout << endl;
    */
    for(int j = 0; j < cut[i].p; j++) swap_p[j] = card[j];
    for(int k = 0; k < cut[i].c; k++) swap_c[k] = card[cut[i].p + k - 1];
    for(int l = 0; l < cut[i].p + cut[i].c - 1;l++){
      if(cut[i].c > l)  card[l] = swap_c[l] ;
      else              card[l] = swap_p[ l - cut[i].c ];
    }
  }
  cout << card[0] << endl;
  return ;
}



int main(){
  while(true){
    cin >> n >> r;
    if(n == 0 && r == 0) break;
    for(int input = 0; input < r; input++){
      cin >> cut[input].p >> cut[input].c ;
    }
    solve();
  }
  return 0;
}



Compiler output:
a.cc: In function 'void solve()':
a.cc:28:28: error: 'i' was not declared in this scope
   28 |     for(int j = 0; j < cut[i].p; j++) swap_p[j] = card[j];
      |                            ^
a.cc:29:28: error: 'i' was not declared in this scope
   29 |     for(int k = 0; k < cut[i].c; k++) swap_c[k] = card[cut[i].p + k - 1];
      |                            ^
a.cc:30:28: error: 'i' was not declared in this scope
   30 |     for(int l = 0; l < cut[i].p + cut[i].c - 1;l++){
      |                            ^
a.cc: At global scope:
a.cc:35:3: error: 'cout' does not name a type
   35 |   cout << card[0] << endl;
      |   ^~~~
a.cc:36:3: error: expected unqualified-id before 'return'
   36 |   return ;
      |   ^~~~~~
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

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

#define rep(i,n) for(int i = 0; i < n; i++)
#define rrep(i,n) for(int i = n - 1; i >= 0; i--)
#define REP(i,k,n) for(int i = k; i < n; i++)

#define vi vector<int>
#define pb push_back
using namespace std;

int main(){
    int n,r;
    while(cin >> n >> r,n) {
        vi card(n);

        rep(i,n) card[i] = n - i;
        rep(i,r){
            cin >> p >> c;
            vi tmp(c);
            rep(j,c) tmp[c] = card[p - 1 + j];
            rrep(j,p - 1) card[j + c - 1] = card[j];
            rep(j,c) card[j] = tmp[c];
        }
        cout << card[0] << endl;
    }
    return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: 'p' was not declared in this scope
   20 |             cin >> p >> c;
      |                    ^
a.cc:20:25: error: 'c' was not declared in this scope
   20 |             cin >> p >> c;
      |                         ^
Language: C++

#include <iostream>

using namespace std;

int main(){
	int n, r;
	int card[50], shuf[50];
	while(cin >> n >> r){
		if(!n) break;
		for(int i=0;i<n;i++) card[i] = n-i;
		for(int i=0;i<r;i++){
			int p, c; cin >> p >> c;
			int j=0;
			for(j=0;j<c;j++) shuf[j] = card[p-1+j];
			for(j=c;j<c+p-1;j++) shuf[j] = card[j-c];
			for(j=c+p-1;j<n;j++) shuf[j] = card[j];
			memcpy(card,shuf,sizeof(card));
		}
		cout << shuf[0] << endl;
	}
}

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

#include <iostream>

using namespace std;

int main(){
	int n, r;
	int card[50];
	while(cin >> n >> r, n){
		for(int i=0;i<n;i++) card[i] = n-i;
		for(int i=0;i<r;i++){
			int p, c; cin >> p >> c;
			rotate(card, card+p-1, card+p+c-1);
		}
		cout << card[0] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: 'rotate' was not declared in this scope
   12 |                         rotate(card, card+p-1, card+p+c-1);
      |                         ^~~~~~
Language: C++

#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
struct ml{
  int dt;
  struct ml *nx;
};
typedef struct ml Ml;
void f(Ml *a,int p,int q){
  int i;
  Ml *b,*c,*d;
  b=a;
  for(i=0;i<p-1;i++)
    b=b->nx;
  c=b;
  for(i=0;i<q;i++)
    c=c->nx;
  d=a->nx;
  a->nx=b->nx;
  b->nx=c->nx;
  c->nx=d;
  return;
}
int main(){
  int i;
  int n,r,p,q;
  Ml *a;
  while(cin>>n>>r&&n+r){
    a=(Ml*)malloc((n+2)*sizeof(Ml));
    for(i=0;i<n+1;i++){
      (a+i)->dt=n-i+1;
      (a+i)->nx=a+i+1;
    }
    (a+i)->dt=n-i+1;
    for(i=0;i<r;i++){
      cin>>p>>q;
      if(p!=1)
	f(a,p,q);
    }
    cout<<a->nx->dt<<endl;
    free(a);x
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:13: error: 'x' was not declared in this scope
   46 |     free(a);x
      |             ^
Language: C++

#include <iostream>

using namespace std;

int n, r, p, c;
int cards[50];
int temp[50];

int main()
{
	while( 1 )
	{
		cin >> n >> r;
		if(n==0 && r==0) break;
		
		for(int i=0; i<n; i++) cards[i] = n-i-1;
		for(int i=0; i<r; i++)
		{
			cin >> p >> c;
			memcpy(&temp[0], &cards[p-1], sizeof(int) * c);
			memcpy(&temp[c], &cards[0], sizeof(int) * (p-1));
			for(int j=0; j<p+c-1; j++) cards[j] = temp[j];
		}
		printf("%d\n", cards[0]+1);
   	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'memcpy' was not declared in this scope
   20 |                         memcpy(&temp[0], &cards[p-1], sizeof(int) * c);
      |                         ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

// ・AOJ1142(setの練習問題)
// ・AOJ1129(vectorの練習問題)
// ・AOJ10032(stackの練習問題)
// ・AOJ10027(stringの練習問題)
// ・AOJ10021(sort || priority_queueの練習問題)
// ・AOJ1064(オーバーロードの練習問題)
// ・AOJ0138(mapの練習問題)
// ・AOJ0105(mapの練習問題)
#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

int main() {
	int n, r, p, c;
	vector<int> v;
	vector<int>::iterator ite;
	while(1){
		scanf("%d%d", &n, &r);
		if(n ==0 && r == 0) break;
		for (int i=1; i<=n; i++) { v.push_back(i); }
		for (int i=0; i<r; i++) {
			scanf("%d%d", &p, &c);
			ite = v.end()-p-c+1;
			for(int j=0; j<c; j++) {
				v.push_back(*ite);
				v.erase(ite);
			}
		// vector<int>::iterator test;
		// test = v.begin();
		// while(test != v.end()){printf("%d", *test); test++;}
		// printf("\n");
		// }
		ite = v.end()-1;
		printf("%d\n", *ite);
	}
}

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

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
  int maisu[50];
  int katto;
  int swap[50];
  int p,c;
  int i,j=0;
  int test;
  for(i=0; i<50; i++){
    maisu[i] = i;
  }
  cout << maisu[0] << endl;
  cin >> katto;
  // while(j <= katto){
    while(true){
      scanf("%d%d",&p,&c);
      if(p == 0 && c == 0){break;}
      for(i=0; i<c; i++){
	swap[i] = maisu[i + p-1];
      }
      for(i = 0; i<p-1; i++){
	swap[i+c] = maisu[i];
      }
      for(i=0;i<p+c-1; i++){
	maisu[i] = swap[i];
      }
    }
    // if(p == 0 && c == 0){
	// break;
    }
  // }
    cout << maisu[0] << endl;
    return 0;
}

Compiler output:
a.cc:37:5: error: 'cout' does not name a type
   37 |     cout << maisu[0] << endl;
      |     ^~~~
a.cc:38:5: error: expected unqualified-id before 'return'
   38 |     return 0;
      |     ^~~~~~
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
int card[50];
int buffer[50];
void main()
{
	int n,r;
	while(cin>>n>>r,n!=0){
		for(int i=0;i<n;i++)card[i]=i+1;
		for(int i=0;i<r;i++){
			int p,c;
			cin>>p>>c;
			for(j=0;j<p-1;j++)
				buffer[j]=card[j];
			for(j=0;j<c;j++)
				card[j]=card[j+p-1];
			for(j=0;j<p-1;j++)
				card[j+c-1]=buffer[j];
		}
		cout<<card[0]<<endl;
	}
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:13:29: error: 'j' was not declared in this scope
   13 |                         for(j=0;j<p-1;j++)
      |                             ^
a.cc:15:29: error: 'j' was not declared in this scope
   15 |                         for(j=0;j<c;j++)
      |                             ^
a.cc:17:29: error: 'j' was not declared in this scope
   17 |                         for(j=0;j<p-1;j++)
      |                             ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)

int main(){
  int n, r;
  while(cin >>n >>r && n){
    vector<int> v;
    for(int i = n; i > 0; i--) v.push_back(i);

    rep(i, r){
      int p, c;
      cin >>p >>c;
      vector<int> next;
      for(int i = 0; i < c; i++) next.push_back(v[p - 1 + i]);
      for(int i = 0; i < p - 1; i++) next.push_back(v[i]);
      for(int i = p + c - 1; i < v.size(); i++) next.push_back(v[i]);
      v = next;
    }
    cout <<v[0] <<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'i' was not declared in this scope
   14 |     rep(i, r){
      |         ^
a.cc:14:5: error: 'rep' was not declared in this scope
   14 |     rep(i, r){
      |     ^~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
typedef pair<int, int> PII;

int main()
{
	int n, r;
	while (cin >> n >> r, n || r) {
		vector<PII> shuffles;
		for (int i = 0; i < r; ++i) {
			int p, c;
			cin >> p >> c;
			shuffles.push_back(make_pair(p, c));
		}
		reverse(shuffles.begin(), shuffles.end());
		int index = 0;
		for (int i = 0; i < shuffles.size(); ++i) {
			int p = shuffles[i].first, c = shuffles[i].second;
			if (index < c) {
				index += p - 1;
			} else if (index < c + p - 1) {
				index -= c;
			}
		}
		cout << n - index << endl;
	}
}

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

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

int main() {
int N,R,p,c;
while (cin>>N>>R&&N) { 
	int A[100]={};
	for(int i=0;i<N;i++){
		A[i]=i+1;
	}
	reverse(A,A+N)
	for (int i=0; i<R; ++i) {
	cin >> p >> c ;
	rotate(A,A+p,A+p+c);

 }
 cout << A[0] << endl;
 }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected ';' before 'for'
   12 |         reverse(A,A+N)
      |                       ^
      |                       ;
   13 |         for (int i=0; i<R; ++i) {
      |         ~~~            
a.cc:13:23: error: 'i' was not declared in this scope
   13 |         for (int i=0; i<R; ++i) {
      |                       ^
Language: C++

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

int main(){
    int n,r;
    for(;;){
        scanf("%d%d",&n,&r);
        if(n==0 && r==0) break;
        int p,c;
        vector<int> ca(n);
        for(int i=0;i<n;i++){
            ca[i]=n-i;
        }
        for(int i=0;i<r;i++){
            scanf("%d%d",&p,&c);
            rotate(begin(ca),begin(ca)+p-1,begin(ca)+p-1+c);
        }
        printf("%d\n",ca[0]);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'rotate' was not declared in this scope
   17 |             rotate(begin(ca),begin(ca)+p-1,begin(ca)+p-1+c);
      |             ^~~~~~
Language: C++

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

using namespace std;

int N, R, p, c, i, j;

int main()
{
   while ( cin >> N >> R && N >0 )
   {
      int A[N] = {};
      for ( i = 0; i < N; i++)
         {
            A[i] = N - i;
         }
      for ( j = 0; j<R; j++)
         {
            cin >> p >> c;
            rotate(A,A+(p-1),A+(p+c-1))
         }
      cout << A[0] <<endl;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:40: error: expected ';' before '}' token
   22 |             rotate(A,A+(p-1),A+(p+c-1))
      |                                        ^
      |                                        ;
   23 |          }
      |          ~
Language: C++

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

using namespace std;

int N, R, p, c, i, j;
int A[N] = {};

int main()
{
   while ( cin >> N >> R && N >0 )
   {
      for ( i = 0; i < N; i++)
         {
            A[i] = N - i;
         }
      for ( j = 0; j<R; j++)
         {
            cin >> p >> c;
            rotate(A,A+(p-1),A+(p+c-1))
         }
      cout << A[0] <<endl;
   }
}

Compiler output:
a.cc:8:7: error: size of array 'A' is not an integral constant-expression
    8 | int A[N] = {};
      |       ^
a.cc: In function 'int main()':
a.cc:21:40: error: expected ';' before '}' token
   21 |             rotate(A,A+(p-1),A+(p+c-1))
      |                                        ^
      |                                        ;
   22 |          }
      |          ~
Language: C++

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

using namespace std;

int N, R, p, c, i, j;
int A[N] = {};

int main()
{
   while ( cin >> N >> R && N >0 )
   {
      int A[N] = {};
      for ( i = 0; i < N; i++)
         {
            A[i] = N - i;
         }
      for ( j = 0; j<R; j++)
         {
            cin >> p >> c;
            rotate(A,A+(p-1),A+(p+c-1))
         }
      cout << A[0] <<endl;
   }
}

Compiler output:
a.cc:8:7: error: size of array 'A' is not an integral constant-expression
    8 | int A[N] = {};
      |       ^
a.cc: In function 'int main()':
a.cc:22:40: error: expected ';' before '}' token
   22 |             rotate(A,A+(p-1),A+(p+c-1))
      |                                        ^
      |                                        ;
   23 |          }
      |          ~
Language: C++

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

using namespace std;

int N, R, p, c, i, j;

int main()
{
   while ( cin >> N >> R && N >0 )
   {
      int A[N];
      for ( i = 0; i < N; i++)
         {
            A[i] = N - i;
         }
      for ( j = 0; j<R; j++)
         {
            cin >> p >> c;
            rotate(A,A+(p-1),A+(p+c-1))
         }
      cout << A[0] <<endl;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:40: error: expected ';' before '}' token
   21 |             rotate(A,A+(p-1),A+(p+c-1))
      |                                        ^
      |                                        ;
   22 |          }
      |          ~
Language: C++

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

int n, r, p, c;
vector<int> cards(50);

void shuffle(int p, int c) {
    reverse(cards.begin(), cards.begin() + p);
    reverse(cards.begin() + p, cards.begin() + p + c);
    reverse(cards.begin(), cards.begin() + p + c);
}

int main() {
    while (1) {
        cin >> n >> r;
        if ( ! n && ! r) break;

        iota(cards.rend() - n, cards.rend(), 1);
        for (int i=0; i<r; ++i) {
            cin >> p >> c;
            shuffle(p - 1, c);
        }
        cout << cards[0] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'iota' was not declared in this scope
   20 |         iota(cards.rend() - n, cards.rend(), 1);
      |         ^~~~
Language: C++

#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

const int INF = 10000000;
using namespace std;
typedef long long  ll;

/** Problem1129 : Hanafuda Shuffle **/
int main()
{
	vector<int> card;
	int n, r, p, c;
	
	while (cin >> n >> r, n||r) {
		card.clear();
		rep(i, n)
			card.push_back(n-i);
		
		rep(k, r) {
			cin >> p >> c;
			vector<int> tmp;
			rep(i, c)
				tmp.push_back(card[i+p-1]);
			rep(i, p-1)
				tmp.push_back(card[i]);
			REP(i, p+c-1, n) {
				tmp.push_back(card[i]);
			}
			card = tmp;
		}
		cout << card[0] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'vector' was not declared in this scope
   14 |         vector<int> card;
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:14:16: error: expected primary-expression before 'int'
   14 |         vector<int> card;
      |                ^~~
a.cc:18:17: error: 'card' was not declared in this scope
   18 |                 card.clear();
      |                 ^~~~
a.cc:24:32: error: expected primary-expression before 'int'
   24 |                         vector<int> tmp;
      |                                ^~~
a.cc:26:33: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   26 |                                 tmp.push_back(card[i+p-1]);
      |                                 ^~~
      |                                 tm
a.cc:28:33: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   28 |                                 tmp.push_back(card[i]);
      |                                 ^~~
      |                                 tm
a.cc:30:33: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   30 |                                 tmp.push_back(card[i]);
      |                                 ^~~
      |                                 tm
a.cc:32:32: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   32 |                         card = tmp;
      |                                ^~~
      |                                tm
Language: Java

import java.util.Scanner;

public class Main {

	static int w,h;
	static int[][] tile;

	public static void main  (String[]args) {

		Scanner in = new Scanner(System.in);

		while(true) {
			w = in.nextInt();
			h = in.nextInt();

			if(w==0) break;

			tile = new int[w][h];
			String s;
			int x=0,y=0;
			for(int i=0; i<w; i++) {
				s = in.next();
				for (int j=0; j<h; j++) {

					if(s.charAt(j)=='#') {
						tile[i][j]=0;
					}else if(s.charAt(j)=='.') {
						tile[i][j]=1;
					}else {
						tile[i][j]=0;
						x = i;
						y = j;
					}

				}
			}
			System.out.println(canMove(x,y));

		}

	}

	public int canMove (int a, int b) {

		int m = 0;
		tile[a][b] = 0;

		if(a>0)if(tile[a-1][b]==1)m+=canMove(a-1,b);
		if(a<w-1)if(tile[a+1][b]==1)m+=canMove(a+1,b);
		if(b>0)if(tile[a][b-1]==1)m+=canMove(a,b-1);
		if(b<h-1)if(tile[a][b+1]==1)m+=canMove(a,b+1);

		return m++;

	}
}



Compiler output:
Main.java:37: error: non-static method canMove(int,int) cannot be referenced from a static context
			System.out.println(canMove(x,y));
			                   ^
1 error
Language: Java

package aoj;

import java.util.Scanner;

/**
 * AOJ id=1130
 * Red and Black
 * @author scache
 *
 */
public class Main1130 {
	public static void main(String[] args) {
		Main1130 p = new Main1130();
	}

	public Main1130() {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			w = sc.nextInt();
			if(w==0) break;
			h = sc.nextInt();
			map = new char[h][w];
			for(int i=0;i<h;i++)
				map[i] = sc.next().toCharArray();
			solve(map);
		}
	}

	int w;
	int h;
	char[][] map;
	public void solve(char[][] map) {
		int sx = -1;
		int sy = -1;
		for(int i=0;i<map.length;i++){
			for(int j=0;j<map[i].length;j++){
				if(map[i][j]=='@'){
					sx = j;
					sy = i;
					break;
				}
			}
			if(sx>=0)
				break;
		}
		System.out.println(rec(sx, sy));
		
	}

	int[] dx = { -1, 0, 1, 0 };
	int[] dy = { 0, -1, 0, 1 };
	private int rec(int curx, int cury) {
		if(map[cury][curx]=='#')
			return 0;	
		
		map[cury][curx] = '#';
		int res = 1;
		for(int i=0;i<4;i++){
			int nx = curx + dx[i];
			int ny = cury + dy[i];
			
			if(nx<0 || w<=nx || ny<0 || h<=ny)
				continue;
			res += rec(nx, ny);
		}
		
		
		return res;
	}

}

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

package com.company;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * Created by YuyaKita on 2015/05/18.
 */
public class RedAndBlack {
    static final int MAX_W = 20, MAX_H = 20;
    static int W, H;
    static char[][] tiles = new char[MAX_H + 1][MAX_W + 1];
    static int count = 0;
    static int[] dx = {-1, 0, 1, 0};
    static int[] dy = {0, -1, 0, 1};

    public static void main(String args[]) throws FileNotFoundException {

        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            W = sc.nextInt();
            H = sc.nextInt();
            if (W == 0 && H == 0) return;
            sc.nextLine();
            for (int i = 0; i < H; i++) {
                tiles[i] = sc.nextLine().toCharArray();
            }

            System.out.println(solve(tiles));
        }

    }

    static int solve(char[][] input) {
        count = 0;
        for (int i = 0; i < W; i++) {
            for (int j = 0; j < H; j++) {
                if (tiles[j][i] == '@') dfs(i, j);
            }
        }
        return count;
    }

    static void dfs(int x, int y) {
        count++;
        tiles[y][x] = '#';
        for (int i = 0; i < dx.length; i++) {
            int nx = x + dx[i];
            int ny = y + dy[i];

            if (nx >= 0 && nx < W && ny >= 0 && ny < H && tiles[ny][nx] == '.') {

                dfs(nx, ny);
            }
        }


    }

}

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

package com.company;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * Created by YuyaKita on 2015/05/18.
 */
public class RedAndBlack {
    static final int MAX_W = 20, MAX_H = 20;
    static int W, H;
    static char[][] tiles = new char[MAX_H + 1][MAX_W + 1];
    static int count = 0;
    static int[] dx = {-1, 0, 1, 0};
    static int[] dy = {0, -1, 0, 1};

    public static void main(String args[]) throws FileNotFoundException {

        Scanner sc = new Scanner(new File("aojIn.txt"));
        while (true) {
            W = sc.nextInt();
            H = sc.nextInt();
            if (W == 0 && H == 0){
                sc.close();
                break;
            }
            sc.nextLine();
            for (int i = 0; i < H; i++) {
                tiles[i] = sc.nextLine().toCharArray();
            }

            System.out.println(solve(tiles));
        }

    }

    static int solve(char[][] input) {
        count = 0;
        for (int i = 0; i < W; i++) {
            for (int j = 0; j < H; j++) {
                if (tiles[j][i] == '@') dfs(i, j);
            }
        }
        return count;
    }

    static void dfs(int x, int y) {
        count++;
        tiles[y][x] = '#';
        for (int i = 0; i < dx.length; i++) {
            int nx = x + dx[i];
            int ny = y + dy[i];

            if (nx >= 0 && nx < W && ny >= 0 && ny < H && tiles[ny][nx] == '.') {

                dfs(nx, ny);
            }
        }


    }

}

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

package com.company;

import java.io.File;
import java.util.Scanner;

/**
 * Created by YuyaKita on 2015/05/18.
 */
public class Main {
    static final int MAX_W = 20, MAX_H = 20;
    static int W, H;
    static char[][] tiles = new char[MAX_H + 1][MAX_W + 1];
    static int count = 0;
    static int[] dx = {-1, 0, 1, 0};
    static int[] dy = {0, -1, 0, 1};

    public static void main(String args[]){

        Scanner sc = new Scanner(System.in);
        while (true) {
            W = sc.nextInt();
            H = sc.nextInt();
            if (W == 0 && H == 0){
                break;
            }
            sc.nextLine();
            for (int i = 0; i < H; i++) {
                tiles[i] = sc.nextLine().toCharArray();
            }

            System.out.println(solve(tiles));
        }
            sc.close();

    }

    static int solve(char[][] input) {javascript:void(0)
        count = 0;
        for (int i = 0; i < W; i++) {
            for (int j = 0; j < H; j++) {
                if (tiles[j][i] == '@') dfs(i, j);
            }
        }
        return count;
    }

    static void dfs(int x, int y) {
        count++;
        tiles[y][x] = '#';
        for (int i = 0; i < dx.length; i++) {
            int nx = x + dx[i];
            int ny = y + dy[i];

            if (nx >= 0 && nx < W && ny >= 0 && ny < H && tiles[ny][nx] == '.') {

                dfs(nx, ny);
            }
        }


    }

}

Compiler output:
Main.java:37: error: illegal start of expression
    static int solve(char[][] input) {javascript:void(0)
                                                 ^
Main.java:37: error: ';' expected
    static int solve(char[][] input) {javascript:void(0)
                                                     ^
2 errors
Language: Java

import java.util.Scanner;

public class DFSKurihara {
	int H, W;
	int[] dx = {1, 0, -1, 0};
	int[] dy = {0, 1, 0, -1};
	void run(){
		Scanner sc = new Scanner(System.in);
		while(true){
			W = sc.nextInt();
			H = sc.nextInt();
			if((H | W) == 0){
				break;
			}
			sc.nextLine();
			char[][] field = new char[H][W];
			for(int i = 0; i < H; ++i){
				field[i] = sc.nextLine().toCharArray(); 
			}
			for(int i = 0; i < H; ++i){
				for(int j = 0; j < W; ++j){
					if(field[i][j] == '@'){
						System.out.println(dfs(field, i, j));
					}
				}
			}
		}
	}
	int dfs(char[][] field, int y, int x){
		if(y < 0 || H <= y || x < 0 || W <= x){
			return 0;
		}
		if(field[y][x] == '#'){
			return 0;
		}
		field[y][x] = '#';
		int ret = 0;
		for(int i = 0; i < 4; ++i){
			ret += dfs(field, y+dy[i], x+dx[i]);
		}
		return ret+1;
	}
	public static void main(String[] args) {
		new DFSKurihara().run();
	}
}

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

#include <iostream>

int H, W;
int map[20][20];
int c;
using namespace std;

void printArray();
void check(int, int);

int main() {
  cin  >> W >> H;
  int sy, sx;
  for (int i = 0; i < H; i++) {
    string line;
    cin >> line;
    for (int j = 0; j < W; j++) {
      if (line[j] == '@') {
        sy = i;
        sx = j;
        map[i][j] = 0;
      } else if (line[j] == '.') {
        map[i][j] = 0;
      } else if (line[j] == '#') {
        map[i][j] = 1;
      }
    }
  }
  // printArray();
  c = 0;
  check(sy, sx);
  // printArray();
  cout << c << endl;
  return 0;
}

void check(int y, int x) {
  if (y < 0 || x < 0 || y >= H || x >= W || map[y][x] == 1) {
    return;
  }
  map[y][x] = 1;
  c++;
  check(y + 1, x);
  check(y - 1, x);
  check(y, x + 1);
  check(y, x - 1);
}

void printArray() {
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cout << map[i][j];
    }
    cout << endl;
  }
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include <iostream>
         ^
Main.java:4: error: class, interface, enum, or record expected
int map[20][20];
^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
int c;
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: class, interface, enum, or record expected
using namespace std;
^
Main.java:9: error: <identifier> expected
void check(int, int);
              ^
Main.java:9: error: <identifier> expected
void check(int, int);
                   ^
Main.java:12: error: not a statement
  cin  >> W >> H;
            ^
Main.java:16: error: not a statement
    cin >> line;
        ^
Main.java:33: error: not a statement
  cout << c << endl;
            ^
Main.java:52: error: not a statement
      cout << map[i][j];
           ^
Main.java:54: error: not a statement
    cout << endl;
         ^
12 errors
Language: Java

import java.util.NoSuchElementException;
import java.util.Scanner;

public class RedandBlack {
    static int c = 0;
    static int[][] directions = {{0, -1}, {0, 1}, {1, 0}, {-1, 0}};
    static int[][] m;

    public static void spreadFrom(int x, int y) {
        if (m[y][x] == 0) {
            m[y][x] = 1;
            c++;
        }

        for (int k =0; k < 4; k++) {
            int nx = x + directions[k][0];
            int ny = y + directions[k][1];
            if (nx >= 0 && nx < m[y].length && ny >= 0 && ny < m.length) {
                spreadFrom(nx, ny);
            }
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            c = 0;
            int W = sc.nextInt();
            int H = sc.nextInt();
            if (W == 0 && H == 0)
                break;
            m = new int[H][W];
            int[] start = new int[2];
            for (int i = 0; i < H; i++) {
                String rowStr = sc.next();
                for (int j = 0; j < W; j++) {
                    int point;
                    switch (Character.toString(rowStr.charAt(j))) {
                        case ".":
                            point = 1;
                            break;
                        case "#":
                            point = 0;
                            break;
                        case "@":
                            point = 2;
                            start[0] = i;
                            start[1] = j;
                            break;
                        default:
                            throw new NoSuchElementException();
                    }
                    m[i][j] = point;
                }
            }
            spreadFrom(start[0], start[1]);
            System.out.println(c);
        }
    }
}

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

import java.util.*;

public class Main {
	static int w, h, count, before;
	static int[][] dir = {{-1,0}, {0,-1}, {1,0}, {0, 1}};
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		while(true){
			w = sc.nextInt();
			h = sc.nextInt();
			sc.nextLine();
			if(w == 0){
				break;
			}

			int[] pos = new int[2];
			int [][] c = new int[h][w];
			char abc;
			String str = new String();
			for(int i = 0; i < h; i++){/* ????????? */
				str = sc.nextLine();/* ?????§???????????? */
				for(int j = 0; j < w; j++){
					abc = str.charAt(j);
					if(abc == '#'){
						c[i][j] = 0;
					}else if(abc == '.'){
						c[i][j] = 1;
					}else if(abc == '@'){
						c[i][j] = 1;
						pos[0] = i;
						pos[1] = j;
					}
				}
			}
			
			count = 0;
			before = 1;
			int y;
			y = search(c , pos[0], pos[1]);
			
			System.out.println(count);
		}
	}
	
	public static int search(int[][] c, int i, int j){
		if(c[i][j] == 0){
			return 0;
		}
		c[i][j] = 0;
		count++;
		
		int d = before + 2/* ????????°????????????????????´???????§???? */;
		if(d > 3){
			d -= 4;
		}
		
		for(int k = 0; k < 4; k++){
			d++;
			if(d > 3){
				d -= 4;
			}
			
			before = d;
			int x = i + dir[d][0], y = j + dir[d][1];
			if((x >= 0) && (x < h) && (y >= 0) && (y < w)){
				int z = search(c, x, y);
			}
		}		
		return 1;
	}

Compiler output:
Main.java:72: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

import java.util.*;
public class RedAndBlack {
	static Scanner sc = new Scanner(System.in);
	static int W, H, res;
	static char [][]field;
	static int[]dx = {-1, 0, 1, 0}, dy = {0, 1, 0, -1};
	public static void main(String[] args) {
		while(read()){
			search_Start();
			System.out.println(res);
		}
	}
	static boolean read(){
		W = sc.nextInt(); H = sc.nextInt();
		if(W == 0 && H == 0)
			return false;
		
		field = new char[H][W];
		res = 0;
		
		String line;
		for(int i = 0; i < H; i++){
			line = sc.next();
			for(int j = 0; j < W; j++)
				field[i][j] = line.charAt(j);
		}
		return true;
	}
	static void search_Start(){
		/**
		 * ツづ慊つクツづ債スツタツーツトツ地ツ点ツづーツ探ツつキツ。
		 */
		for(int i = 0; i < H; i++){
			for(int j = 0; j < W; j++){
				/**
				 * ツ個ゥツづつつッツつスツづァツ探ツ催オツ開ツ始
				 */
				if(field[i][j] == '@')
					dfs(j, i);
			}
		}
	}
	static void dfs(int x, int y){
		field[y][x] = '#';
		res++;
		int mx = 0, my = 0;
		for(int i = 0; i < 4; i++){
			mx = x + dx[i]; my = y + dy[i];
			if( 0 <= mx && mx < W && 0 <= my && my < H && field[my][mx] == '.')
				dfs(mx, my);
		}
	}

}

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

import java.util.*;
    
public class Main {
  private static Scanner sc = new Scanner(System.in);
  public static void main(String...args) {
    while(sc.hasNext()) {
      final int W = sc.nextInt();
      final int H = sc.nextInt();
      if (W == 0 && H == 0)
        break;
      solve(W, H);
    }
  }
  private static void solve(final int W, final int H) {
    final char[][] map = new char[H][];
    for(int i = 0; i < H; i+;)
      map[i] = sc.next().toCharArray();
    final Deque<Integer> deq = new ArrayDeque<Integer>();
    for(int i = 0; i < H; i++)
      for(int j = 0; j < W; j++)
        if(map[i][j] == '@')
          deq.offer(i * W + j);
    int ans = 0;
    while(!deq.isEmpty()) {
      final int p = deq.poll();
      final int i = p / W;
      final int j = p % W;
      for(int d = 0; d < 4; d++) {
        final int ni = i + di[d];
        final int nj = j + dj[d];
        if(0 <= ni && ni < H && 0 <= nj && nj < W && map[ni][nj] == '.') {
          map[ni][nj] = '#';
          deq.offer(ni * W + nj);
          ans++;
        }
      }
    }
    System.out.println(ans);
  }
  private static final int[] di = { 1, 0, -1, 0};
  private static final int[] dj = { 0, 1, 0, -1 };
}

Compiler output:
Main.java:16: error: illegal start of expression
    for(int i = 0; i < H; i+;)
                            ^
Main.java:16: error: not a statement
    for(int i = 0; i < H; i+;)
                           ^
Main.java:16: error: illegal start of expression
    for(int i = 0; i < H; i+;)
                             ^
3 errors
Language: Java

import java.util.*;

class Main{
   public static void main(String a[]) throws java.io.IOException{
       Scanner scan =new Scanner (System.in);
       Pair pair= new Pair();
       Queue<Pair> fifo = new LinkedList<Pair>();

       while(true){

           int W =scan.nextInt();
           int H =scan.nextInt();
           if((W|H)==0)break;
           char  [][] map = new char [H][W];
           for(int i=0;i<H;i++){
               String  tmp =scan.next();
               for(int j=0;j<W;j++){
                   map[i][j] = tmp.charAt(j);
                   if(tmp.charAt(j)=='@'){
                       
                       pair.x=j;
                       pair.y=i;
                       fifo.add(pair);
                   }
               }
           }
          int count =0;
          while(fifo.peek()!=null){  
           pair = fifo.poll();
           int x=pair.x;
           int y=pair.y;
           int[] dx ={0,1,0,-1};
           int[] dy ={1,0,-1,0};
          for(int i=0;i<4;i++){
              int nx =x+dx[i];
              int ny =y+dy[i];
              if(0<=nx&&nx<W&&0<=ny&&ny<H&&map[ny][nx]!='#'){
                  Pair npair =new Pair();
                  npair.x=nx;
                  npair.y=ny;
                  fifo.add(npair);
                  map[ny][nx] = '#';
                  count++;
              }
          } 
          
          System.out.println(count);

       }
       }
}

class Pair{
    public int x;
    public int y;
}

Compiler output:
Main.java:56: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.*;
class Main
{
    int dx[]={-1,0,1,0};
    int dy[]={0,1,0,-1};
    char[][] map;
    void run()
    {
	Scanner sc=new Scanner(System.in);
	while(true){
	    int W=sc.nextInt();
	    int H=sc.nextInt();sc.nextLine();
	    if(W==0&&H==0)break;
	    
	    int startX=0,startY=0;
	    map=new char[H+2][W+2];
	    for(int i=0;i<H+2;i++){
		Arrays.fill(map[i],'#');
	    }
	    for(int i=1;i<H+1;i++){
		char[] s=sc.next().toCharArray();
		for(int j=0;j<W;j++){	
		    if(s[j]=='@'){
			startY=i;
			startX=j+1;
		    }
		    map[i][j+1]=s[j];	
		}
	    }
	    System.out.println(DFS(startY,startX));
	}
    }
    int DFS(int y,int x)
    {
	if(map[y][x]=='#')return 0;
	map[y][x]='#';
	int sum=1;
	for(int i=0;i<4;i++){
	    sum+=DFS(y+dy[i],x+dx[i]);
	}
	return sum;
    }
    
    public static void main(String[] args)
    {
	new AOJ1130().run();
    }
}

Compiler output:
Main.java:46: error: cannot find symbol
	new AOJ1130().run();
	    ^
  symbol:   class AOJ1130
  location: class Main
1 error
Language: Java

import java.util.Scanner;
import java.util.Stack;

public class Main2 {
	static int[] v1 = { 0, 1, 0, -1 };
	static int[] v2 = { 1, 0, -1, 0 };
	static int[][] field;
	static int count = 0;
	public static void main(String[] args) {

		Scanner cin = new Scanner(System.in);
		while (true) {
			int w = cin.nextInt();
			int h = cin.nextInt();
			if(w+h==0){break;}
			
			int startx = 0, starty = 0;
			count=0;
			field = new int[h + 2][w + 2];
			for (int i = 1; i <= h; i++) {
				String str = cin.next();
				for (int j = 1; j <= w; j++) {
					if (str.charAt(j-1) == '.') {
						field[i][j] = 1;
					} else if (str.charAt(j-1) == '#') {
						field[i][j] = 2;
					} else if (str.charAt(j-1) == '@') {
						field[i][j] = 1;
						startx = i;
						starty = j;
					}
				}
			}
			Integer[] start = {startx,starty};
			Stack<Integer[]> s = new Stack<Integer[]>();
			s.add(start);
			while(!s.isEmpty()){
				Integer[] a = s.pop();
				count++;
				field[a[0]][a[1]]=2;
				for(int i = 0;i<4;i++){
					int xx = a[0]+v1[i];
					int yy = a[1]+v2[i];
					if(field[xx][yy]==1){
						Integer[] next={xx,yy};
						s.add(next);
					}
				}
			}
			System.out.println(count);
		}
	}

}

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: Java

import java.io.*;
import java.util.*;


public class p1130 {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));       
		try {
			String line;
			while(true){
				/* input */
				line = br.readLine();

				int w = Integer.parseInt(line.split(" ")[0]);
				int h = Integer.parseInt(line.split(" ")[1]);
				if(w == 0 && h == 0){
					return;
				} 
				int[][] field = new int[h][w];
				int[] pos = new int[2]; 
				for(int i=0;i<h;i++){
					String str = br.readLine();
					for(int j=0;j<w;j++){
						if(str.charAt(j)=='.'){
							field[i][j] = 1;
						} else if(str.charAt(j)=='#'){
							field[i][j] = 0;
						} else {
							field[i][j] = 2;
							pos[0] = i;
							pos[1] = j;
						}
					}
				}
				/* processing */
				int res = search(pos[0],pos[1],field,h,w);
				
				/* output */
				System.out.println(res);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static int search(int posi, int posj, int[][] field,int h,int w){
		int sum = 1;
		field[posi][posj] = 2;
		
		//up
		if(posi>0&&field[posi-1][posj]==1){
			sum += search(posi-1,posj,field,h,w);
		}
		//right
		if(posj<w-1&&field[posi][posj+1]==1){
			sum += search(posi,posj+1,field,h,w);
		}
		
		//down
		if(posi<h-1&&field[posi+1][posj]==1){
			sum += search(posi+1,posj,field,h,w);
		}
		
		//left
		if(posj>0&&field[posi][posj-1]==1){			
			sum += search(posi,posj-1,field,h,w);
		}

		return sum;
	}
	
}

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

import java.util.Scanner;

/**
 * Created by Reopard on 2014/05/29.
 */
public class RedandBlack {

    static Scanner sc = new Scanner(System.in);
    static char[][] tile = new char[22][22];
    static char black_tile = '.', red_tile = '#', player_tile = '@';
    static int W = 0, H = 0;

    public static void main(String args[]) {
        int x = 0, y = 0;
        while ((W = sc.nextInt()) != 0 && (H = sc.nextInt()) != 0) {
            for (int i = 0; i <= W + 1; i++) tile[0][i] = red_tile;
            for (int i = 1; i <= H; i++) tile[i] = (red_tile + sc.next() + red_tile).toCharArray();
            for (int i = 0; i <= W + 1; i++) tile[H + 1][i] = red_tile;
            outer:
            for (int i = 1; i <= H; i++) {
                for (int j = 1; j <= W; j++) {
                    if (tile[i][j] == player_tile) {
                        x = j;
                        y = i;
                        break outer;
                    }
                }
            }
            System.out.println(countBlackTile(x, y)/4);
        }
    }

    static int countBlackTile(int x, int y) {
        int[] dx = {0, 1, 0, -1};
        int[] dy = {-1, 0, 1, 0};
        int count = 0;
        if (tile[y][x] == red_tile) return 0;
        else {
            tile[y][x] = red_tile;
            for(int i = 0; i < 4; i++) {
                count += countBlackTile(x + dx[i], y + dy[i]) + 1;
            }
        }
        return count;
    }
}

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

import java.util.Scanner;

/**
 * Created by Reopard on 2014/05/29.
 */
public class RedandBlack {

    static Scanner sc = new Scanner(System.in);
    static char[][] tile;
    static char black_tile = '.', red_tile = '#', player_tile = '@';
    static int W = 0, H = 0;

    public static void main(String args[]) {
        int x = 0, y = 0;
        while ((W = sc.nextInt()) != 0 && (H = sc.nextInt()) != 0) {
            tile = new char[H+2][W+2];
            for (int i = 0; i <= W + 1; i++) tile[0][i] = red_tile;
            for (int i = 1; i <= H; i++) tile[i] = (red_tile + sc.next() + red_tile).toCharArray();
            for (int i = 0; i <= W + 1; i++) tile[H + 1][i] = red_tile;
            outer:
            for (int i = 1; i <= H; i++) {
                for (int j = 1; j <= W; j++) {
                    if (tile[i][j] == player_tile) {
                        x = j;
                        y = i;
                        break outer;
                    }
                }
            }
            /*for (int i = 0; i <= H+1; i++){
                for(int j = 0; j <= W+1; j++){
                    System.out.print(tile[i][j]);
                }
                System.out.println();
            }
            System.out.println(tile[y][x]);*/
            System.out.println(countBlackTile(x, y));
        }
    }

    static int countBlackTile(int x, int y) {
        int[] dx = {0, 1, 0, -1};
        int[] dy = {-1, 0, 1, 0};
        int count = 1;
        if (tile[y][x] == red_tile) return 0;
        else {
            tile[y][x] = red_tile;
            for(int i = 0; i < 4; i++) {
                count += countBlackTile(x + dx[i], y + dy[i]);
            }
        }
        return count;
    }
}

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

#include <stdio.h>

int que[400][2], top, end;
int dir[4][2]={{1,0}{0,1}{0,-1}{-1,0}};
char tile1[22][22], tile2[22][22];

int main(void)
{
    int w, h, i, a1, a2, b1, b2, ans;
    
    while(scanf("%d %d ", &w, &h)&&w){
        memset(tile1, 0, sizeof(tile1));
        for(i=0, a1=0; a1<h; a1++){
            scanf("%s", tile1[a1]);
            for(b1=0; b1<w; b1++){
                if(map[a1][b1])=='@'){
                    que[0][0]=a1, que[0][1]=b1;
                    tile1[a1][b1]=1, top=0, end=1, i=1:
                }
            }
        }
        while(top<end){
            a1=que[top][0], b1=que[top++][1];
            for(i=0; i<4; i++){
                a2=a1+dir[i][0], b2=b1+dir[i][1];
                if(a2<0||a2>=h||b2<0||b2>=w||tile2[a2][b2]=='#')
                    continue;
                tile1[a2][b2]=1;
                que[end][0]=a2, que[end][1]=b2;
            }
        }
        for(ans=0, a1=0;, a1<h; a1++)
            for(b1=0; b1<w; b1++)
                ans+=tile1[a1][b1];
        printf("%d\n", ans);
    }
}



Compiler output:
main.c:4:21: error: expected '}' before '{' token
    4 | int dir[4][2]={{1,0}{0,1}{0,-1}{-1,0}};
      |               ~     ^
main.c: In function 'main':
main.c:12:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
   12 |         memset(tile1, 0, sizeof(tile1));
      |         ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'memset'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:12:9: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
   12 |         memset(tile1, 0, sizeof(tile1));
      |         ^~~~~~
main.c:12:9: note: include '<string.h>' or provide a declaration of 'memset'
main.c:16:20: error: 'map' undeclared (first use in this function)
   16 |                 if(map[a1][b1])=='@'){
      |                    ^~~
main.c:16:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:32: error: expected expression before '==' token
   16 |                 if(map[a1][b1])=='@'){
      |                                ^~
main.c:16:37: error: expected statement before ')' token
   16 |                 if(map[a1][b1])=='@'){
      |                                     ^
main.c:18:55: error: expected ';' before ':' token
   18 |                     tile1[a1][b1]=1, top=0, end=1, i=1:
      |                                                       ^
      |                                                       ;
main.c:32:25: error: expected expression before ',' token
   32 |         for(ans=0, a1=0;, a1<h; a1++)
      |                         ^