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

#include <iostream>
using namespace std;

int main(){
	int human[5];
	while(cin>>human[0],human[0]){
		bool hand[3]={};
		for(int i=1;i<5;i++){
			cin>>human[i];
			if(human[i]==1) hand[0]++;
			else if(human[i]==2) hand[1]++;
			else hand[2]++;
		}
		if((hand[0]==true&&hand[0]==hand[1]&&hand[0]==hand[2])||(hand[0]==false&&hand[0]==hand[1]))||(hand[0]==false&&hand[0]==hand[2]))||(hand[1]==false&&hand[1]==hand[2])) for(int i=0;i<5;i++)cout<<'3'<<endl;
		else if(hand[0]==)
		else if(hand[0]==true&&hand[0]==hand[1]){
			for(int i=0;i<5;i++){
				if(human[i]==1)cout<<'1'<<endl;
				else cout<<'2'<<endl;
			}
		}
		else if(hand[0]==true&&hand[0]==hand[2]){
			for(int i=0;i<5;i++){
				if(human[i]==3)cout<<'1'<<endl;
				else cout<<'2'<<endl;
			}
		}
		else if(hand[1]==true&&hand[1]==hand[2]){
			for(int i=0;i<5;i++){
				if(human[i]==2)cout<<'1'<<endl;
				else cout<<'2'<<endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:47: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   10 |                         if(human[i]==1) hand[0]++;
      |                                         ~~~~~~^
a.cc:11:52: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   11 |                         else if(human[i]==2) hand[1]++;
      |                                              ~~~~~~^
a.cc:12:36: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   12 |                         else hand[2]++;
      |                              ~~~~~~^
a.cc:14:108: error: expected primary-expression before '||' token
   14 |                 if((hand[0]==true&&hand[0]==hand[1]&&hand[0]==hand[2])||(hand[0]==false&&hand[0]==hand[1]))||(hand[0]==false&&hand[0]==hand[2]))||(hand[1]==false&&hand[1]==hand[2])) for(int i=0;i<5;i++)cout<<'3'<<endl;
      |                                                                                                            ^~
a.cc:14:195: error: 'i' was not declared in this scope
   14 |                 if((hand[0]==true&&hand[0]==hand[1]&&hand[0]==hand[2])||(hand[0]==false&&hand[0]==hand[1]))||(hand[0]==false&&hand[0]==hand[2]))||(hand[1]==false&&hand[1]==hand[2])) for(int i=0;i<5;i++)cout<<'3'<<endl;
      |                                                                                                                                                                                                   ^
a.cc:15:17: error: 'else' without a previous 'if'
   15 |                 else if(hand[0]==)
      |                 ^~~~
a.cc:15:34: error: expected primary-expression before ')' token
   15 |                 else if(hand[0]==)
      |                                  ^
a.cc:16:17: error: expected primary-expression before 'else'
   16 |                 else if(hand[0]==true&&hand[0]==hand[1]){
      |                 ^~~~
Language: C++


#include <iostream>
using namespace std;

int main(){
	int human[5];
	while(cin>>human[0],human[0]){
		if(human[0]==1) hand[0]++;
		else if(human[0]==2) hand[1]++;
		else hand[2]++;
		bool hand[3]={0,0,0};
		for(int i=1;i<5;i++){
			cin>>human[i];
			if(human[i]==1) hand[0]++;
			else if(human[i]==2) hand[1]++;
			else hand[2]++;
		}
		if((hand[0]==true&&hand[0]==hand[1]&&hand[0]==hand[2])||(hand[0]==false&&hand[0]==hand[1])||(hand[0]==false&&hand[0]==hand[2])||(hand[1]==false&&hand[1]==hand[2])){
			for(int i=0;i<5;i++)cout<<'3'<<endl;
		}
		else if(hand[0]==true&&hand[0]==hand[1]){
			for(int i=0;i<5;i++){
				if(human[i]==1)cout<<'1'<<endl;
				else cout<<'2'<<endl;
			}
		}
		else if(hand[0]==true&&hand[0]==hand[2]){
			for(int i=0;i<5;i++){
				if(human[i]==3)cout<<'1'<<endl;
				else cout<<'2'<<endl;
			}
		}
		else if(hand[1]==true&&hand[1]==hand[2]){
			for(int i=0;i<5;i++){
				if(human[i]==2)cout<<'1'<<endl;
				else cout<<'2'<<endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:33: error: 'hand' was not declared in this scope; did you mean 'rand'?
    8 |                 if(human[0]==1) hand[0]++;
      |                                 ^~~~
      |                                 rand
a.cc:9:38: error: 'hand' was not declared in this scope; did you mean 'rand'?
    9 |                 else if(human[0]==2) hand[1]++;
      |                                      ^~~~
      |                                      rand
a.cc:10:22: error: 'hand' was not declared in this scope; did you mean 'rand'?
   10 |                 else hand[2]++;
      |                      ^~~~
      |                      rand
a.cc:14:47: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   14 |                         if(human[i]==1) hand[0]++;
      |                                         ~~~~~~^
a.cc:15:52: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   15 |                         else if(human[i]==2) hand[1]++;
      |                                              ~~~~~~^
a.cc:16:36: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   16 |                         else hand[2]++;
      |                              ~~~~~~^
Language: C++

int i,n,d=0b10110001000000;main(c,v){for(;;){for(v=c=i=0;i-5;++i){scanf("%d",&n);if(!n)exit(0);v|=n<<i*2;c|=1<<n;}for(n=((d>>c)&3),i=0;i-5;++i){printf("%d\n",v>>i*2&3-n?(n?2:3):1);}}}

Compiler output:
a.cc:1:32: error: expected constructor, destructor, or type conversion before '(' token
    1 | int i,n,d=0b10110001000000;main(c,v){for(;;){for(v=c=i=0;i-5;++i){scanf("%d",&n);if(!n)exit(0);v|=n<<i*2;c|=1<<n;}for(n=((d>>c)&3),i=0;i-5;++i){printf("%d\n",v>>i*2&3-n?(n?2:3):1);}}}
      |                                ^
Language: C++

#include<iostream>
#include<vector>
int main(){
	while(1){
		std::vector<int> vec(5);
		std::vector<int> vec2(5);
		int a;
		std::cin>>a;
		if(a==0)break;
		vec[0]=a;
		int d,e,f;
		if(a==1)d++;
		if(a==2)e++;
		if(a==3)f++;
		for(int i=1;i<5;i++){
			int b;
			if(b==1)d++;
			if(b==2)e++;
			if(b==3)f++;
			std::cin>>b;
		}
		std::vector<int> vec2(5);
		if(d>=1&&e>=1&&f>=1||d==5||f==5||e==5){
			for(int i=0;i<5;i++){
				vec2[i]=3;
			}
		}else if(d>=1&&e>=1&&f==0){
			for(int i=0;i<5;i++){
				if(vec[i]==1)vec2[i]=1;
				if(vec[i]==2)vec2[i]=2;
			}
		}else if(d>=0&&e>=1&&f==1){
			for(int i=0;i<5;i++){
				if(vec[i]==2)vec2[i]=1;
				if(vec[i]==3)vec2[i]=2;
			}
		}else if(d>=1&&e>=0&&f==1){
			for(int i=0;i<5;i++){
				if(vec[i]==1)vec2[i]=2;
				if(vec[i]==3)vec2[i]=1;
			}
		}
		for(int i=0;i<5;i++){
			std::cout<<vec2[i]<<std::endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:34: error: redeclaration of 'std::vector<int> vec2'
   22 |                 std::vector<int> vec2(5);
      |                                  ^~~~
a.cc:6:34: note: 'std::vector<int> vec2' previously declared here
    6 |                 std::vector<int> vec2(5);
      |                                  ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
long x[5],h[4],i;
while(cin>>x[0]){
if(x[0]==0)break;
for(i=1;i<=3;i++)h[i]=0;
h[x[0]]++;
for(i=1;i<5;i++){cin>>x[i];h[x[i]]++;}
for(j=0,i=1;i<=3;i++)if(h[i]==0)j++;
if(j==2||j==0){
for(i=0;i<5;i++)cout<<"3"<<endl;
else if(j==1){
for(i=1;i<=3;i++)if(h[i]==0)break;
if(i==1){
for(i=0;i<5;i++)cout<<x[i]-1<<endl;
}else if(i==2){
for(i=0;i<5;i++)cout<<(x[i]+1)%3<<endl;
}else if(i==3){
for(i=0;i<5;i++)cout<<x[i]<<endl;
}
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'j' was not declared in this scope
   10 | for(j=0,i=1;i<=3;i++)if(h[i]==0)j++;
      |     ^
a.cc:11:4: error: 'j' was not declared in this scope
   11 | if(j==2||j==0){
      |    ^
a.cc:13:1: error: expected '}' before 'else'
   13 | else if(j==1){
      | ^~~~
a.cc:11:15: note: to match this '{'
   11 | if(j==2||j==0){
      |               ^
Language: C++

#include<stdio.h>

int main(void)
{
  int t[5]={0},t2=0,t3=0,t1=0,k,i;

while(scanf("%d",&k)!=0){

t2=0; t3=0; t1=0;

for(i=0;i<5;i++){
scnaf("%d",&t[i]);
  if(t[i]==1)
       t1++;
else if(t[i]==2)
   t2++;
else if(t[i]==3)
   t3++;
}

if(t1==0){
  if(t2==0 or t3==0)
   for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==2)  t[i]=1;
      else if(t[i]==3) t[i]=2;
    }
}
else if(t2==0){
  if(t1==0 or t3==0)
   for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==1)  t[i]=2;
      else if(t[i]==3) t[i]=1;
}
}

else if(t3==0){
  if(t2==0 or t1==0)
   for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==2)  t[i]=2;
      else if(t[i]==1) t[i]=1;
}
}
else
   for(i=0;i<5;i++) t[i]=3;
for(i=0;i<5;i++)
   printf("%d\n",t[i]);
}
return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:1: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   12 | scnaf("%d",&t[i]);
      | ^~~~~
      | scanf
a.cc:54:9: error: expected ';' before '}' token
   54 | return 0
      |         ^
      |         ;
   55 | }
      | ~
Language: C++

#include<stdio.h>

int main(void)
{
  int t[5]={0},t2=0,t3=0,t1=0,k,i;

while(scanf("%d",&k)!=0){

t2=0; t3=0; t1=0;

for(i=0;i<5;i++){
scnaf("%d",&t[i]);
  if(t[i]==1)
       t1++;
else if(t[i]==2)
   t2++;
else if(t[i]==3)
   t3++;
}

if(t1==0){
  if(t2==0 or t3==0) for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==2)  t[i]=1;
      else if(t[i]==3) t[i]=2;
    }
}
else if(t2==0){
  if(t1==0 or t3==0)   for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==1)  t[i]=2;
      else if(t[i]==3) t[i]=1;
}
}

else if(t3==0){
  if(t2==0 or t1==0)  for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==2)  t[i]=2;
      else if(t[i]==1) t[i]=1;
}
}

else   for(i=0;i<5;i++) t[i]=3;
}
for(i=0;i<5;i++)  printf("%d\n",t[i]);

return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:1: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   12 | scnaf("%d",&t[i]);
      | ^~~~~
      | scanf
a.cc:51:9: error: expected ';' before '}' token
   51 | return 0
      |         ^
      |         ;
   52 | }
      | ~
Language: C++

#include<stdio.h>

int main(void)
{
  int t[5]={0},t2=0,t3=0,t1=0,k,i;

while(scanf("%d",&k)!=0){

t2=0; t3=0; t1=0;

for(i=0;i<5;i++){
scnaf("%d",&t[i]);
  if(t[i]==1)
       t1++;
else if(t[i]==2)
   t2++;
else if(t[i]==3)
   t3++;
}

if(t1==0){
  if((t2==0) or (t3==0)) for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==2)  t[i]=1;
      else if(t[i]==3) t[i]=2;
    }
}
else if(t2==0){
  if((t1==0) or (t3==0))   for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==1)  t[i]=2;
      else if(t[i]==3) t[i]=1;
}
}

else if(t3==0){
  if((t2==0) or (t1==0))  for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==2)  t[i]=2;
      else if(t[i]==1) t[i]=1;
}
}

else   for(i=0;i<5;i++) t[i]=3;
}
for(i=0;i<5;i++)  printf("%d\n",t[i]);

return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:1: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   12 | scnaf("%d",&t[i]);
      | ^~~~~
      | scanf
a.cc:51:9: error: expected ';' before '}' token
   51 | return 0
      |         ^
      |         ;
   52 | }
      | ~
Language: C++

#include<stdio.h>

int main(void)
{
  int t[5]={0},t2=0,t3=0,t1=0,k,i;

while(scanf("%d",&k)!=0){

t2=0; t3=0; t1=0;

for(i=0;i<5;i++){
scnaf("%d",&t[i]);
  if(t[i]==1)
       t1++;
else if(t[i]==2)
   t2++;
else if(t[i]==3)
   t3++;
}

if(t1==0){
  if((t2==0) || (t3==0)) for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==2)  t[i]=1;
      else if(t[i]==3) t[i]=2;
    }
}
else if(t2==0){
  if((t1==0) || (t3==0))   for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==1)  t[i]=2;
      else if(t[i]==3) t[i]=1;
}
}

else if(t3==0){
  if((t2==0) || (t1==0))  for(i=0;i<5;i++) t[i]=3;
else
   for(i=0;i<5;i++){
       if(t[i]==2)  t[i]=2;
      else if(t[i]==1) t[i]=1;
}
}

else   for(i=0;i<5;i++) t[i]=3;
}
for(i=0;i<5;i++)  printf("%d\n",t[i]);

return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:1: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   12 | scnaf("%d",&t[i]);
      | ^~~~~
      | scanf
a.cc:51:9: error: expected ';' before '}' token
   51 | return 0
      |         ^
      |         ;
   52 | }
      | ~
Language: C++

#include <iostream>
using namespace std;

bool is_draw(int* first, int* last) {
    bool used[3] = {false, false, false};
    for (int* p = first; p != last; p++) {
        used[*p - 1] = true;
    }
    return all_of(used, used + 3, [used](bool x) {return x;});
}

int get_win(int* first, int* last) {
    int mi = 5, ma = 0;
    for (int*p = first; p != last; p++) {
        mi = min(mi, *p);
        ma = max(ma, *p);
    }
    if (ma - mi == 1) return mi;
    return ma;
}

int main() {
    int hands[5];
    while (cin >> hands[0], hands[0]) {
        for (int i = 1; i < 5; i++) {
            cin >> hands[i];
        }
        if (is_draw(hands, hands + 5)) {
            for (int i = 0; i < 5; i++) {
                cout << 3 << endl;
            }
        }
        else {
            int win = get_win(hands, hands + 5);
            for (int i = 0; i < 5; i++) {
                if (hands[i] == win) {
                    cout << 1 << endl;
                }
                else {
                    cout << 2 << endl;
                }
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'bool is_draw(int*, int*)':
a.cc:9:12: error: 'all_of' was not declared in this scope
    9 |     return all_of(used, used + 3, [used](bool x) {return x;});
      |            ^~~~~~
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class NextTrip {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		ArrayList<String> arr = new ArrayList<>();

		while (true) {
			int border = Integer.parseInt(scan.next());
			if (border == 0) {
				break;
			}
			String ret;
			int sum = 0;
			for (int i = 0; i < 12; i++) {
				int m = Integer.parseInt(scan.next());
				int n = Integer.parseInt(scan.next());
				int sub = m - n;
				sum += sub;
				if (sum >= border) {
					ret = String.valueOf(i + 1);
					break;
				}
			}
			ret = "NA";

			arr.add(ret);
		}
		arr.stream().forEach(System.out::println);
	}

}

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

import java.util.Scanner;

class Main {
  public static void main(String[] args){
    //declare
    ArrayList<String> answer = new ArrayList<>();
    ArrayList<Integer> month = new ArrayList<>();
    Scanner in = new Scanner(System.in);
    int L,M,N,total;
    //inmput
    while(true){
      total=0;
      L = Integer.parseInt(in.next());
      if(L==0){break;}
      //calculate
      for(int i=1;i<=12;i++){
        M = Integer.parseInt(in.next());
        N = Integer.parseInt(in.next());
        total += M - N;
        if(L-total<=0){month.add(i);}
      }
      if(L-total<=0){answer.add(String.valueOf(month.get(0)));}
      else{answer.add("NA");}
    }
    //output
    for(String s:answer){
      if (s=="NA"){System.out.println("NA");}
      else{System.out.println(Integer.parseInt(s));}
    }
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    ArrayList<String> answer = new ArrayList<>();
    ^
  symbol:   class ArrayList
  location: class Main
Main.java:6: error: cannot find symbol
    ArrayList<String> answer = new ArrayList<>();
                                   ^
  symbol:   class ArrayList
  location: class Main
Main.java:7: error: cannot find symbol
    ArrayList<Integer> month = new ArrayList<>();
    ^
  symbol:   class ArrayList
  location: class Main
Main.java:7: error: cannot find symbol
    ArrayList<Integer> month = new ArrayList<>();
                                   ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: Java

import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		while(true){
			int tripCost = stdIn.nextInt();
			if(tripCost == 0)break;
			for(int i=1;i<=12;i++){
				if(i==12){
					System.out.println("NA");
					break;
				}
				savingMoney += stdIn.nextInt() - stdIn.nextInt();
				if(savingMoney >= tripCost){
					System.out.println(i);
					break;
				}
			}
		}
	}
}

Compiler output:
Main.java:14: error: cannot find symbol
				savingMoney += stdIn.nextInt() - stdIn.nextInt();
				^
  symbol:   variable savingMoney
  location: class Main
Main.java:15: error: cannot find symbol
				if(savingMoney >= tripCost){
				   ^
  symbol:   variable savingMoney
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		while(true){
			int tripCost = stdIn.nextInt();
			if(tripCost == 0)break;
			for(int i=1;i<=12;i++){
				if(i==12){
					System.out.println("NA");
					break;
				}
				savingMoney += (stdIn.nextInt() - stdIn.nextInt());
				if(savingMoney >= tripCost){
					System.out.println(i);
					break;
				}
			}
		}
	}
}

Compiler output:
Main.java:14: error: cannot find symbol
				savingMoney += (stdIn.nextInt() - stdIn.nextInt());
				^
  symbol:   variable savingMoney
  location: class Main
Main.java:15: error: cannot find symbol
				if(savingMoney >= tripCost){
				   ^
  symbol:   variable savingMoney
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		while(true){
			int tripCost = stdIn.nextInt();
			if(tripCost == 0)break;
			for(int i=1;i<=12;i++){
				if(i==12){
					System.out.println("NA");
					break;
				}
				savingMoney = savingMoney + stdIn.nextInt() - stdIn.nextInt();
				if(savingMoney >= tripCost){
					System.out.println(i);
					break;
				}
			}
		}
	}
}

Compiler output:
Main.java:14: error: cannot find symbol
				savingMoney = savingMoney + stdIn.nextInt() - stdIn.nextInt();
				^
  symbol:   variable savingMoney
  location: class Main
Main.java:14: error: cannot find symbol
				savingMoney = savingMoney + stdIn.nextInt() - stdIn.nextInt();
				              ^
  symbol:   variable savingMoney
  location: class Main
Main.java:15: error: cannot find symbol
				if(savingMoney >= tripCost){
				   ^
  symbol:   variable savingMoney
  location: class Main
3 errors
Language: Java

import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		while(true){
			int tripCost = stdIn.nextInt();
			if(tripCost == 0)break;
			for(int i=1;i<=12;i++){
				if(i==12){
					System.out.println("NA");
					break;
				}
				int income = stdIn.nextInt();
				int payOut = stdIn.nextInt();
				savingMoney = savingMoney + income - payOut;
				if(savingMoney >= tripCost){
					System.out.println(i);
					break;
				}
			}
		}
	}
}

Compiler output:
Main.java:16: error: cannot find symbol
				savingMoney = savingMoney + income - payOut;
				^
  symbol:   variable savingMoney
  location: class Main
Main.java:16: error: cannot find symbol
				savingMoney = savingMoney + income - payOut;
				              ^
  symbol:   variable savingMoney
  location: class Main
Main.java:17: error: cannot find symbol
				if(savingMoney >= tripCost){
				   ^
  symbol:   variable savingMoney
  location: class Main
3 errors
Language: Java

import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		while(true){
			int tripCost = stdIn.nextInt();
			if(tripCost == 0)break;
			
			int i = 1;
			while(true){
				else{
					int income = stdIn.nextInt();
					int payOut = stdIn.nextInt();
					int savingMoney = savingMoney + income - payOut;
					if(savingMoney >= tripCost){
						System.out.println(i);
						break;
					}
				}if(i==13){
					System.out.println("NA");
					break;
				}
				i++;
			}
		}
	}
}

Compiler output:
Main.java:12: error: 'else' without 'if'
				else{
				^
1 error
Language: Java

import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		while(true){
			int tripCost = stdIn.nextInt();
			if(tripCost == 0)break;
			
			int i = 1;
			while(true){
				int income = stdIn.nextInt();
				int payOut = stdIn.nextInt();
				int savingMoney = savingMoney + income - payOut;
				if(savingMoney >= tripCost){
					System.out.println(i);
					break;
				}
				i++;
				if(i==13){
					System.out.println("NA");
					break;
				}
			}
		}
	}
}

Compiler output:
Main.java:14: error: variable savingMoney might not have been initialized
				int savingMoney = savingMoney + income - payOut;
				                  ^
1 error
Language: C

#include<stdio.h>

int main(void) 
{
	int a[11], b, c, d, e, g = 0;
	scanf_s("%d", &c);
	for (b = 0; b < 12; b++)
	{
		scanf("%d %d", &d, &e);
		a[b] = d - e;
		g = g + a[b];
		if (g >= c)
		{
			printf("%d\n", b);
			break;
		}
		else if (b == 11)
		{
			printf("NA\n");
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%d", &c);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>

int main(void)
{
	int a[12], b, c, d, e, f;
	while (1) {
		scanf_s("%d", &b);
		c = 0;
		if (b == 0) break;
		for (d = 0;d < 12;d++)
		{
			scanf_s("%d %d", &e, &f);
			c += e - f;
			a[d] = c;
		}
		for (d = 0;d < 12;d++){
			if (a[d] >= b)
			{
				printf("%d\n", d + 1);
				break;
			}
	}
	if (c < b)printf("NA\n");
}
return;
}

Compiler output:
main.c: In function 'main':
main.c:7:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |                 scanf_s("%d", &b);
      |                 ^~~~~~~
      |                 scanf
main.c:25:1: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   25 | return;
      | ^~~~~~
main.c:3:5: note: declared here
    3 | int main(void)
      |     ^~~~
Language: C

#include<stdio.h>
int main(void) {
	int M, N, L, s=0,i,num[12],z;
	while (1) {
		scanf_s("%d",&L);
		s = 0;
		if (L == 0)break;
		for (i = 0; i < 12; i++) {
			scanf_s("%d %d", &M, &N);
			s += M - N;
			num[i] = s;
		}
		for (i = 0; i < 12; i++) {
			if (num[i] >= L) {
				printf("%d\n", i + 1);
				break;
			}
		}
		if (s < L)printf("NA\n");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |                 scanf_s("%d",&L);
      |                 ^~~~~~~
      |                 scanf
Language: C

include <stdio.h>

int main(void){
    int L,M1,M2,sum,i,month;

    while(1){
        sum=0;
        scanf("%d",&L);
        if(L==0)
            break;
        for(i=0;i<12;i++){
            scanf("%d %d",&M1,&M2);
            sum+=M1-M2;
            if(sum>=L){
                printf("%d",i);
                break;
            }
        }
        if(sum<L)
            puts("NA");
    }
    return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

#include <stdio.h>

int main(void){
    int L,M1,M2,sum,i,month;

    while(1){
        sum=0;
        month=0;
        scanf("%d",&L);
        if(L==0)
            break;
        for(i=0;i<12;i++){
            scanf("%d %d",&M1,&M2);
            sum+=M1-M2;
            if(sum>=L&&month==0){
                printf("%d",i);
            }
        }
        if(sum<L)
            puts("NA");
    }
    return 0;
}
~

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

             #include <stdio.h>

int main(void){
    int m, n, l;
    int sum = 0;

    i = 1;
    while(1){
        scanf("%d", &l);
        if(l == 0)
            break;

        scanf("%d %d", &m, &n);
        sum += m - n;
        if(i == 12){
            if(sum < l)
                printf("NA");
            i = 1;
            sum = 0;
        }
    }
    printf("%d\n", i);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:5: error: 'i' undeclared (first use in this function)
    7 |     i = 1;
      |     ^
main.c:7:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void){
    int L,M1,M2,sum,i,month;

    while(1){
        sum=0;
        month=0;
        scanf("%d",&L);
        if(L==0)
            break;
        for(i=0;i<12;i++){
            scanf("%d %d",&M1,&M2);
            sum+=M1-M2;
            if(sum>=L&&month==0){
                month=i+1;
            }
        }
        if(month>0&&month<=12)
            printf("%d\n",month);
        else
            puts("NA");
    }
    return 0;
}
~

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

main(l,m,n,a,i{for(;a=12,scanf("%d",&l),l;printf((a>11)?"NA\n":"%d\n",a+1))for(i=0;i<12;++i)if(scanf("%d%d",&m,&n),(l-=m-n)<1)a=(a<i)?a:i;}

Compiler output:
main.c:1:15: error: expected ')' before '{' token
    1 | main(l,m,n,a,i{for(;a=12,scanf("%d",&l),l;printf((a>11)?"NA\n":"%d\n",a+1))for(i=0;i<12;++i)if(scanf("%d%d",&m,&n),(l-=m-n)<1)a=(a<i)?a:i;}
      |               ^
      |               )
Language: C++

#include<iostream>
using namespace std;
int main(){
    int L;
    cin >> L;
    int t;
    t = 0;
    for(i=0;i<12;++i){
        int Plus;
        int Minus;
        cin >> Plus >> Minus;
        t += Plus - Minus
        if (t>=L){
            cout << i+1 << endl;
            break;
        }
        }
    if (t<L){
        cout << "NA" << endl;
    }
    return 0;
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     for(i=0;i<12;++i){
      |         ^
a.cc:12:26: error: expected ';' before 'if'
   12 |         t += Plus - Minus
      |                          ^
      |                          ;
   13 |         if (t>=L){
      |         ~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int L;
    cin >> L;
    int t;
    t = 0;
    for(int i=0;i<12;++i){
        int Plus;
        int Minus;
        cin >> Plus >> Minus;
        t += Plus - Minus
        if (t>=L){
            cout << i+1 << endl;
            break;
        }
        }
    if (t<L){
        cout << "NA" << endl;
    }
    return 0;
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before 'if'
   12 |         t += Plus - Minus
      |                          ^
      |                          ;
   13 |         if (t>=L){
      |         ~~
Language: C++

int main(){
    int L;
    cin >> L;
    int t;
    t = 0;
    for(int i=0;i<12;++i){
        int Plus;
        int Minus;
        cin >> Plus >> Minus;
        t += Plus - Minus
        if (t>=L){
            cout << i+1 << endl;
            break;
        }
        };
    if (t<L){
        cout << "NA" << endl;
    }
    return 0;
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> L;
      |     ^~~
a.cc:10:26: error: expected ';' before 'if'
   10 |         t += Plus - Minus
      |                          ^
      |                          ;
   11 |         if (t>=L){
      |         ~~                
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout << "NA" << endl;
      |         ^~~~
a.cc:17:25: error: 'endl' was not declared in this scope
   17 |         cout << "NA" << endl;
      |                         ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int L;
    cin >> L;
    int t;
    t = 0;
    for(int i=0;i<12;++i){
        int Plus;
        int Minus;
        cin >> Plus >> Minus;
        t += Plus - Minus
        if (t>=L){
            cout << i+1 << endl;
            break;
        }
        }
        
    if (t<L){
        cout << "NA" << endl;
    }
    return 0;
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before 'if'
   12 |         t += Plus - Minus
      |                          ^
      |                          ;
   13 |         if (t>=L){
      |         ~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int L;
    cin >> L;
    int t;
    t = 0;
    for(int i=0;i<12;++i){
        int Plus;
        int Minus;
        cin >> Plus >> Minus;
        t += Plus - Minus
        if (t>=L){
            cout << i+1 << endl;
            break;
        }
        };
    if (t<L){
        cout << "NA" << endl;
    }
    return 0;
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before 'if'
   12 |         t += Plus - Minus
      |                          ^
      |                          ;
   13 |         if (t>=L){
      |         ~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int n,m,s,sum;
	while(cin >> n && n!=0){
		sum=0;
		int i;
		for(i=0;i<12;i++){
			cin >> m >> s;
			sum+=m-s;
			if(sum>=n){
				cout << i+1 << endl;
			break;
			}
		}
		for(i=i+1;i<12;i++){
		cin >> m >> s;
		if(sum<n)
		cout << "NA" << endl;
	}
	return 0;
}

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

#include<stdio.h>
int main(void)
{
	int w,n,z,x,i,k,c;
	while(1){
		scanf("%d",&n);
		 if(n==0) break;
	c=0;
	k=0;	 
	for(i=0;i<12;i++){
			scanf("%d %d",&z,&x);
			k+=z-x;
			if(k>=n){
				c++
			}
	}
	if(k<n){
		printf("NA\n");
	}
	else{
		printf("%d\n",12-c+1);
	}
    }	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:36: error: expected ';' before '}' token
   14 |                                 c++
      |                                    ^
      |                                    ;
   15 |                         }
      |                         ~
Language: C++

#include <stdio.h>
int main(){
    int n,l,r,tot;
    bool f;
    while(1){
        scanf("%d",&n);
        if(n==0)return 0;
        tot=0;
        f=false;
        for(int i=0;i<12;i++){
            scanf("%d%d",&l,&r);
            tot+=l-r;
            if(tot>=n&&!f){
                f=true;
                printf("%d\n",i+1);
            }
        }
        if(!F)printf("NA\n");
        
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: 'F' was not declared in this scope
   18 |         if(!F)printf("NA\n");
      |             ^
Language: C++

#include<iostream>
#define N 12

int main () {

  int L;
  int sum;
  int mon;
  bool skip;

  while ( true ) {
    cin >> L;
    if ( L == 0 )
      break;
    //sum = L;
    skip = false;
    for ( int i=0; i<N; i++ ) {
      cin >> m >> n;
      L -= m-n;
      if ( L <= 0 && !skip )
	mon = i+1;
      
    }

    if ( skip )
      cout << mon;
    else
      cout << "NA\n";
   }

}


    

    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |     cin >> L;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:18:14: error: 'm' was not declared in this scope
   18 |       cin >> m >> n;
      |              ^
a.cc:18:19: error: 'n' was not declared in this scope
   18 |       cin >> m >> n;
      |                   ^
a.cc:26:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |       cout << mon;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:28:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   28 |       cout << "NA\n";
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
int main(){
	while(1){
		int a;
		std::cin>>a;
		if(a==0)break;
		int b,c=0;
		for(int i=1;i<13;i++){
			int n,m;
			std::cin>>n>>m;
			b+=n;
			b-=m;
			if(b>=a)std::cout<<i<<std::endl,c=1,break;
		}
		if(c==0)std::cout<<"NA"<<std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:61: error: expected primary-expression before 'break'
   13 |                         if(b>=a)std::cout<<i<<std::endl,c=1,break;
      |                                                             ^~~~~
Language: C++

#include <iosteam>
#include <vector>
using namespace std;
int main(void)
{
	int cost,saving;
	vector< vector<int> > money(12,2);
	while(1){
		cin >> cost;
		if(cost==0) break;
		saving=0;
		for(int i=0i<12;i++){
			cin >> money[i][0] >> money[i][1];
		}
		for(int i=0;i<12;i++){
			saving+=money[i][0]-[i][1];
			if(cost<=saving){
				cout << i+1 << endl;
				break;
			}
		}
		if(money<saving) cout << "NA" << endl;
		money.clear();
	}
	return 0;
}

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

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <sstream>

#define mp make_pair
#define rep(i,n) for(int i = 0 ; i < n ; i++)
#define ll long long

using namespace std;

int main(){
	int l;
	while( cin >> l , l)
	{
		int money=0 , i , ans=0;
		for( i = 0; i<12; i++)  
		{
			int n , m;
			cin >> m >> n;
			money += m-n;
			if( l < money ) {
				ans = i+1;
				l = INT_MAX;
			}
		}
		if( ans ) cout << ans;
		else cout << "NA";
		puts("");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:37: error: 'INT_MAX' was not declared in this scope
   27 |                                 l = INT_MAX;
      |                                     ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <sstream>
  +++ |+#include <climits>
    8 |
Language: C++

int main(void){
	int L,M,N,k[12],i,kai;

	while(0==0){
		scanf("%d\n",&L);
		if(L==0) break;

		kai=0;

		for(i=1;i<13;i++){
			scanf("%d %d\n",&M,&N);
			k[i]=M-N;
		}

        for(i=1;i<1;i++){
			L-=k[i];
			  if(L<=0){
				  kai=i;
				  break;
			  }
		}

		if(kai==0) printf("NA\n");
	    else printf("%d\n",kai);
	}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: 'scanf' was not declared in this scope
    5 |                 scanf("%d\n",&L);
      |                 ^~~~~
a.cc:23:28: error: 'printf' was not declared in this scope
   23 |                 if(kai==0) printf("NA\n");
      |                            ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void){
a.cc:24:18: error: 'printf' was not declared in this scope
   24 |             else printf("%d\n",kai);
      |                  ^~~~~~
a.cc:24:18: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: Java

20 20 
1 1
9 9
7
2 0 1 1
5 1 1 3
2 1 3 3
1 1 5 2
5 1 7 3
2 0 2 7
2 0 6 8
20 20
9 9
1 1
6
2 0 1 1
1 0 5 1
2 1 1 3
5 0 1 7
3 1 5 5
4 1 8 5
0 0

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
20 20 
^
1 error
Language: Java


import java.util.*;
public class Main {
	int [][] field;
	int goalx;
	int goaly;
	int moveColor;

	private boolean move(int x, int y){

		if(field[y][x] != moveColor){
			return false;
		}
		if(x == goalx && y == goaly){
			return true;
		}

		field[y][x] = -1;
		if(move(x+1,y) || move(x,y+1) || move(x-1,y) || move(x,y-1))
			return true;
		else
			return false;

	}

	public void doIt(){
		Scanner sc = new Scanner(System.in);
		field = new int[102][102];
		while(true){
			int w = sc.nextInt();
			int h = sc.nextInt();
			if(w == 0 && h == 0)
				break;
			for(int i=0; i < 102; i++){
				for(int j=0;j < 102; j++){
					field[i][j] = 0;
				}
			}
			int xs = sc.nextInt();
			int ys = sc.nextInt();
			goalx = sc.nextInt();
			goaly = sc.nextInt();
			int n = sc.nextInt();

			//read a block
			int [][] block = new int[n][4];
			for(int i=0; i < n; i++){
				for(int j=0; j < 4; j++){
					block[i][j] = sc.nextInt();
				}
				int x = block[i][2];
				int y = block[i][3];
				if(block[i][1] == 0){
					for(int k=y; k < y+2; k++ ){
						for(int j=x; j < x+4; j++){
							field[k][j] = block[i][0];
						}
					}
				}
				else{
					for(int k=y; k < y+4; k++ ){
						for(int j=x; j < x+2; j++){
							field[k][j] = block[i][0];
						}
					}
				}
			}

			//set flame
			for(int i=0; i <= w + 1; i++){
				field[0][i] = -1;
				field[h+1][i] = -1;
				field[i][0] = -1;
				field[i][w+1] = -1;
			}

			//start
			boolean ans;
			moveColor = field[ys][xs];
			if(moveColor == 0){
				ans= false;
			}
			else{
				ans = move(xs, ys);
			}

			//print
			if(ans)
				System.out.println("OK");
			else
				System.out.println("NG");

		}

	}
	public static void main(String[] args) {
		Main obj = new Main();
		obj.doIt();

	}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.StringTokenizer;

/**
 * Block
 */
public class P0207 {

	static int[][] board;
	final static int BLOCK_WIDTH = 4;
	final static int BLOCK_HEIGHT = 2;
	final static int EMPTY = 0;

	static int w, h;

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";

		while (!(line = br.readLine()).equals("0 0")) {

			w = Integer.parseInt(line.substring(0, line.indexOf(' ')));
			h = Integer.parseInt(line.substring(line.indexOf(' ') + 1));

			board = new int[w + 1][h + 1];

			line = br.readLine();
			int xs = Integer.parseInt(line.substring(0, line.indexOf(' ')));
			int ys = Integer.parseInt(line.substring(line.indexOf(' ') + 1));

			line = br.readLine();
			int xg = Integer.parseInt(line.substring(0, line.indexOf(' ')));
			int yg = Integer.parseInt(line.substring(line.indexOf(' ') + 1));

			int n = Integer.parseInt(br.readLine());
			for (int i = 0; i < n; ++i) {
				putBlock(br.readLine());
			}

			if (solve(xs, ys, xg, yg)) {
				System.out.println("OK");
			} else {
				System.out.println("NG");
			}

		}

	}

	static void putBlock(String info) {
		StringTokenizer st = new StringTokenizer(info);

		int c, d, x, y;
		c = Integer.parseInt(st.nextToken());
		d = Integer.parseInt(st.nextToken());
		x = Integer.parseInt(st.nextToken());
		y = Integer.parseInt(st.nextToken());

		putBlock(c, d, x, y);
	}

	static void putBlock(int c, int d, int x, int y) {

		if (d == 0) {
			for (int i = x; i < x + BLOCK_WIDTH; ++i) {
				for (int j = y; j < y + BLOCK_HEIGHT; ++j) {
					// assert board[i][j] == EMPTY;
					board[i][j] = c;
				}
			}
		} else {
			for (int i = x; i < x + BLOCK_HEIGHT; ++i) {
				for (int j = y; j < y + BLOCK_WIDTH; ++j) {
					// assert board[i][j] == EMPTY;
					board[i][j] = c;
				}
			}
		}
	}

	static boolean solve(int xs, int ys, int xg, int yg) {

		final int V[] = { 1, -1, 0, 0 };
		final int H[] = { 0, 0, 1, -1 };

		if (board[xs][ys] != board[xg][yg]) {
			return false;
		}

		int[] next, prev;
		next = new int[] { xs, ys };
		ArrayDeque<int[]> queue = new ArrayDeque<int[]>();
		queue.offer(next);

		while (!queue.isEmpty()) {

			prev = queue.poll();

			int px, py, nx, ny, c;
			px = prev[0];
			py = prev[1];
			c = board[px][py];
			board[px][py] = EMPTY;

			if (px == xg && py == yg) {
				return true;
			}

			for (int i = 0; i < 4; ++i) {
				nx = px + V[i];
				ny = py + H[i];
				if (nx > 0 && nx < w + 1 && ny > 0 && ny < h + 1) {
					if (board[nx][ny] == c) {
						queue.offer(new int[] { nx, ny });
					}
				}
			}
		}

		return false;
	}
}

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

import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;
public class Main {
	public static final int[] blockW = {4,2};
	public static final int[] blockH = {2,4};
	public static final int INF = 100000000;
	public static final int[] vx = {1,0,-1,0};
	public static final int[] vy = {0,-1,0,1};
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		while(true) {
			int w = sc.nextInt();
			int h = sc.nextInt();
			if (w+h==0) {
				break;
			}

			Pos2d start = new Pos2d(sc.nextInt()-1,sc.nextInt()-1);
			Pos2d goal = new Pos2d(sc.nextInt()-1,sc.nextInt()-1);

			int n = sc.nextInt();
			int[][] maze = new int[w][h];
			for (int i=0;i<n;i++) {
				int c = sc.nextInt();
				int d = sc.nextInt();
				int x = sc.nextInt()-1;
				int y = sc.nextInt()-1;
				for (int j=0;j<blockW[d];j++) {
					for (int k=0;k<blockH[d];k++) {
						maze[x+j][y+k] = c;
					}
				}
			}

			boolean ans = false;
			if (maze[start.x][start.y]!=0) {
				int mc = maze[start.x][start.y];
				boolean[][] reach = new boolean[w][h];
				Queue<Pos2d> q = new ArrayDeque<Pos2d>();
				q.offer(start);
				while(!q.isEmpty()) {
					Pos2d p = q.poll();
					for(int i=0;i<4;i++) {
						int nx = p.x + vx[i];
						int ny = p.y + vy[i];
						if (nx>= 0 && nx<w && ny>=0 && ny<h) {
							if (maze[nx][ny]==mc) {
								if (!reach[nx][ny]) {
									reach[nx][ny]=true;
									q.offer(new Pos2d(nx,ny));
								}
							}
						}
					}
				}
				ans = reach[goal.x][goal.y];
			}
			System.out.println(ans ? "OK" : "NG");
		}
	}
}

Compiler output:
Main.java:20: error: cannot find symbol
			Pos2d start = new Pos2d(sc.nextInt()-1,sc.nextInt()-1);
			^
  symbol:   class Pos2d
  location: class Main
Main.java:20: error: cannot find symbol
			Pos2d start = new Pos2d(sc.nextInt()-1,sc.nextInt()-1);
			                  ^
  symbol:   class Pos2d
  location: class Main
Main.java:21: error: cannot find symbol
			Pos2d goal = new Pos2d(sc.nextInt()-1,sc.nextInt()-1);
			^
  symbol:   class Pos2d
  location: class Main
Main.java:21: error: cannot find symbol
			Pos2d goal = new Pos2d(sc.nextInt()-1,sc.nextInt()-1);
			                 ^
  symbol:   class Pos2d
  location: class Main
Main.java:41: error: cannot find symbol
				Queue<Pos2d> q = new ArrayDeque<Pos2d>();
				      ^
  symbol:   class Pos2d
  location: class Main
Main.java:41: error: cannot find symbol
				Queue<Pos2d> q = new ArrayDeque<Pos2d>();
				                                ^
  symbol:   class Pos2d
  location: class Main
Main.java:44: error: cannot find symbol
					Pos2d p = q.poll();
					^
  symbol:   class Pos2d
  location: class Main
Main.java:52: error: cannot find symbol
									q.offer(new Pos2d(nx,ny));
									            ^
  symbol:   class Pos2d
  location: class Main
8 errors
Language: Java

import java.lang.annotation.Retention;
import java.util.*;

import org.omg.CORBA.Principal;
public class Main {
	Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		new Main();
	}
	public Main() {
		new AOJ0207();
	}
	
	class AOJ0207{
		int w,h;
		int sx,sy,gx,gy;
		int[][] map;
		
		void makeBoead(int bx,int by,int muki,int color){
			if(muki==0){//横
				for(int i=0;i<2;i++)for(int s=0;s<4;s++)map[by+i][bx+s]=color;
			}else if(muki==1){
				for(int i=0;i<4;i++)for(int s=0;s<2;s++)map[by+i][bx+s]=color;
			}
		}
		
		void print(){
			for(int i=1;i<=h;i++){
				for(int s=0;s<w;s++)System.out.print(map[i][s]);
				System.out.println();
			}
		}
		
		public AOJ0207() {
			while(true){
				w = in.nextInt();
				h = in.nextInt();
				if(w==0&&h==0)break;
				map = new int[h+1][w+1];
				sx = in.nextInt(); sy = in.nextInt();
				gx = in.nextInt(); gy = in.nextInt();
				int n = in.nextInt();
				for(int i=0;i<n;i++){
					int color = in.nextInt();
					int muki = in.nextInt();
					int bx = in.nextInt();
					int by = in.nextInt();
					makeBoead(bx, by, muki, color);
				}
//				print();
				LinkedList<Integer> list = new LinkedList<Integer>();
				list.add(sx);list.add(sy);
				boolean sw = false;//flg
				int[] gox = {1,0,-1,0};
				int[] goy = {0,1,0,-1};
				int target_c = map[sy][sx];
				while(list.size()>0){
					int x = list.remove();
					int y = list.remove();
					if(x==gx&&y==gy){
						sw=true;
						break;
					}
					for(int i=0;i<4;i++){
						int nx = x+gox[i];
						int ny = y+goy[i];
						if(nx<0||nx>w||ny<0||ny>h)continue;
						if(map[ny][nx]!=target_c)continue;
						map[ny][nx] = -1;
						list.add(nx);list.add(ny);
					}
				}
				System.out.println(sw? "OK":"NG");
			}
		}
	}
}

Compiler output:
Main.java:4: error: package org.omg.CORBA does not exist
import org.omg.CORBA.Principal;
                    ^
1 error
Language: C

#include<stdio.h>

int flag=0;
int mp[102][102];
int sn[102][102];
int bc;

int px[4]={0,1,0,-1};
int py[4]={1,0,-1,0};

int slv(int xs,int ys);

int w,h,xg,yg;
int n,c,d,x,y;  
int i,j,k;

int main(){
  int xs,ys;
  while(1){
    cin>>w>>h;
    if(w==0 && h==0)return(0);
    cin>>xs>>ys;
    cin>>xg>>yg;
    flag=0;
    cin>>n;
    memset(mp,0,sizeof(mp));
    memset(sn,0,sizeof(sn));
    for( i=0;i<n;i++){
      cin>>c>>d>>x>>y;
      if(d==1){
	for( j=0;j<4;j++){
	  for( k=0;k<2;k++)mp[x+k][y+j]=c;
	}
      }
      else{
	for( j=0;j<2;j++){
	  for( k=0;k<4;k++)mp[x+k][y+j]=c;
	}
      }
    }
    
    bc=mp[xs][ys];
    
    slv(xs,ys);
    
    if(flag)cout<<"OK"<<endl;
    else cout<<"NG"<<endl;
    
  }
}

int slv(int xs,int ys){
  if(xs==xg && ys==yg){
    flag=1;
    return(0);
  }
  
  for(i=0;i<4;i++){
    xs+=px[i];
    ys+=py[i];
    if(bc==mp[xs][ys] && sn[xs][ys]==0){
      sn[xs][ys]=1;
      slv(xs,ys);
    }
    xs-=px[i];
    ys-=py[i];
  }
  return(0);
}

Compiler output:
main.c: In function 'main':
main.c:20:5: error: 'cin' undeclared (first use in this function)
   20 |     cin>>w>>h;
      |     ^~~
main.c:20:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:5: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
   26 |     memset(mp,0,sizeof(mp));
      |     ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'memset'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:26:5: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
   26 |     memset(mp,0,sizeof(mp));
      |     ^~~~~~
main.c:26:5: note: include '<string.h>' or provide a declaration of 'memset'
main.c:46:13: error: 'cout' undeclared (first use in this function)
   46 |     if(flag)cout<<"OK"<<endl;
      |             ^~~~
main.c:46:25: error: 'endl' undeclared (first use in this function)
   46 |     if(flag)cout<<"OK"<<endl;
      |                         ^~~~
Language: C

20 20 
1 1
9 9
7
2 0 1 1
5 1 1 3
2 1 3 3
1 1 5 2
5 1 7 3
2 0 2 7
2 0 6 8
20 20
9 9
1 1
6
2 0 1 1
1 0 5 1
2 1 1 3
5 0 1 7
3 1 5 5
4 1 8 5
0 0

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 20 20
      | ^~