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

#include <iostream>
using namespace std;

int F[102][102];


int DFS(int Y,int X,int c){
  int cnt = 0;
  if(F[Y][X] != c){
    return 0;
  }

  F[Y][X] = -1;
  cnt += DFS(Y-1,X  ,c);
  cnt += DFS(Y  ,X+1,c);
  cnt += DFS(Y+1,X  ,c);
  cnt += DFS(Y  ,X-1,c);
  return cnt;
}


int main(){
  int w,h,xs,ys,xg,yg,n;
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0)
      break;

      for(int i=0;i<102;i++){
        for(int j=0;j<102;j++){
                F[i][j]=0;
        }
      }
    cin >> xs >> ys >> xg >> yg >> n;


    for(int i=0;i<n;i++){
      int c,d,x,y;
      cin >> c >> d >> x >> y;
      if(d == 0){
        for(int j=0;j<4;j++){
          F[x+j][y] = c;
          F[x+j][y+1] = c;
        }
      } else {
        for(int j=0;j<4;j++){
          F[x][y+j] = c;
          F[x+1][y+j] = c;
        }
      }
    }
  DFS(xs,ys,F[xs][ys])
  if(1){
    cout << "OK" << endl;
  } else {
    cout << "NG" << endl;
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:23: error: expected ';' before 'if'
   52 |   DFS(xs,ys,F[xs][ys])
      |                       ^
      |                       ;
   53 |   if(1){
      |   ~~                   
a.cc:55:5: error: 'else' without a previous 'if'
   55 |   } else {
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int F[102][102];


int DFS(int Y,int X,int c){
  int cnt = 0;
  if(F[Y][X] != c){
    return 0;
  }

  F[Y][X] = -1;
  cnt += DFS(Y-1,X  ,c);
  cnt += DFS(Y  ,X+1,c);
  cnt += DFS(Y+1,X  ,c);
  cnt += DFS(Y  ,X-1,c);
  return cnt;
}


int main(){
  int w,h,xs,ys,xg,yg,n;
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0)
      break;

      for(int i=0;i<102;i++){
        for(int j=0;j<102;j++){
                F[i][j]=0;
        }
      }
    cin >> xs >> ys >> xg >> yg >> n;


    for(int i=0;i<n;i++){
      int c,d,x,y;
      cin >> c >> d >> x >> y;
      if(d == 0){
        for(int j=0;j<4;j++){
          F[x+j][y] = c;
          F[x+j][y+1] = c;
        }
      } else {
        for(int j=0;j<4;j++){
          F[x][y+j] = c;
          F[x+1][y+j] = c;
        }
      }
    }
  DFS(xs,ys,F[xs][ys])
  if(x == 8){
    cout << "OK" << endl;
  } else {
    cout << "NG" << endl;
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:23: error: expected ';' before 'if'
   52 |   DFS(xs,ys,F[xs][ys])
      |                       ^
      |                       ;
   53 |   if(x == 8){
      |   ~~                   
a.cc:55:5: error: 'else' without a previous 'if'
   55 |   } else {
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int F[102][102];


int DFS(int Y,int X,int c){
  int cnt = 0;
  if(F[Y][X] != c){
    return 0;
  }

  F[Y][X] = -1;
  cnt += DFS(Y-1,X  ,c);
  cnt += DFS(Y  ,X+1,c);
  cnt += DFS(Y+1,X  ,c);
  cnt += DFS(Y  ,X-1,c);
  return cnt;
}


int main(){
  int w,h,xs,ys,xg,yg,n;
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0)
      break;

      for(int i=0;i<102;i++){
        for(int j=0;j<102;j++){
                F[i][j]=0;
        }
      }
    cin >> xs >> ys >> xg >> yg >> n;


    for(int i=0;i<n;i++){
      int c,d,x,y;
      cin >> c >> d >> x >> y;
      if(d == 0){
        for(int j=0;j<4;j++){
          F[x+j][y] = c;
          F[x+j][y+1] = c;
        }
      } else {
        for(int j=0;j<4;j++){
          F[x][y+j] = c;
          F[x+1][y+j] = c;
        }
      }
    }
  DFS(xs,ys,F[xs][ys]);
  if(x == 8){
    cout << "OK" << endl;
  } else {
    cout << "NG" << endl;
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:6: error: 'x' was not declared in this scope
   53 |   if(x == 8){
      |      ^
Language: C++


#include <iostream>
using namespace std;

int C[102][102];
int ans;
int xg,yg;

void meiro(int W,int H,int c){
 if(W==xg && H==yg){
   ans = 1;
   return;
 }

 if(C[W][H]!=c){
   return;
 }

 C[W][H] = '.';

 meiro(W-1,H  ,c);
 meiro(W  ,H+1,c);
 meiro(W+1,H  ,c);
 meiro(W  ,H-1,c);
}

int main(){
 while(1){
   int w,h;
   cin >> w >> h;

   if(w==0 && h==0){
     break;
   }

   int xs,ys;
   cin >> xs >> ys;

   cin >> xg >> yg;

   int n;
   cin >> n;
   int c[n],d[n],x[n],y[n];

   int cbase;

   for(int i=0;i<n;i++){
     cin >> c[i] >> d[i] >> x[i] >> y[i];

     if(d[i]==0){
       for(int j=x[i];j<x[i]+4;j++){
         for(int k=y[i];k<y[i]+2;k++){
           C[j][k]=c[i];
         }
       }
     }
     if(d[i]==1){
       for(int j=x[i];j<x[i]+2;j++){
         for(int k=y[i];k<y[i]+4;k++){
           C[j][k]=c[i];
         }
       }
     }

     if(x[i]==1 &&y[i]==1){
       cbase = c[i];
     }
   }
   ans = 0;
if(cbasew == 0){
 cout << "NG"<<endl;
 continue;
}
   meiro(xs,ys,cbase);

   if(ans==1){
     cout << "OK" << endl;
   }else{
     cout << "NG" << endl;
   }
 }

 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:70:4: error: 'cbasew' was not declared in this scope; did you mean 'cbase'?
   70 | if(cbasew == 0){
      |    ^~~~~~
      |    cbase
Language: C++

include<iostream>
using namespace std;

struct board{
  int mass[102][102];
};

bool goal_flag;
void DFS(int x,int y,int gx,int gy,board b,int c){
    if(b.mass[y][x]!=c)return;
    if(!b.mass[y][x])return;
    b.mass[y][x]=-1;
    if(x==gx&&y==gy)goal_flag=true;
    DFS(x+1,y,gx,gy,b,c);
    DFS(x-1,y,gx,gy,b,c);
    DFS(x,y+1,gx,gy,b,c);
    DFS(x,y-1,gx,gy,b,c);
}

int main(){
  int h,w;
  int start_x,start_y;
  int goal_x,goal_y;
  int n;
  int c,d,x,y;
  while(1){
    cin>>w>>h;
    if(w==0&&h==0)break;
    cin>>start_x>>start_y;
    cin>>goal_x>>goal_y;
    cin>>n;

    board b;
    for(int i=0;i<h+2;i++){
      for(int j=0;j<w+2;j++){
        b.mass[i][j]=0;
      }
    }

    for(int i=0;i<n;i++){
        cin>>c>>d>>x>>y;
        for(int j=0;j<2;j++){
          for(int k=0;k<4;k++){
            if(d==0){b.mass[y+j][x+k]=c;}
            else if(d==1){b.mass[y+k][x+j]=c;}
          }
        }
    }
    goal_flag=false;
    DFS(start_x,start_y,goal_x,goal_y,b,b.mass[start_y][start_x]);
    if(goal_flag)cout<<"OK";
    else cout<<"NG";
    cout<<endl;
  }
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:27:5: error: 'cin' was not declared in this scope
   27 |     cin>>w>>h;
      |     ^~~
a.cc:51:18: error: 'cout' was not declared in this scope
   51 |     if(goal_flag)cout<<"OK";
      |                  ^~~~
a.cc:52:10: error: 'cout' was not declared in this scope
   52 |     else cout<<"NG";
      |          ^~~~
a.cc:53:5: error: 'cout' was not declared in this scope
   53 |     cout<<endl;
      |     ^~~~
a.cc:53:11: error: 'endl' was not declared in this scope
   53 |     cout<<endl;
      |           ^~~~
Language: C++

#include <iostream>
using namespace std;

int C[102][102];
int ans;
int xg,yg;

void meiro(int W,int H,int c){
  if(W==xg && H==yg){
    ans = 1;
    return;
  }

  if(C[W][H]!=c){
    return;
  }

  C[W][H] = '.';

  meiro(W-1,H  ,c);
  meiro(W  ,H+1,c);
  meiro(W+1,H  ,c);
  meiro(W  ,H-1,c);
}

int main(){
  while(1){
    int w,h;
    cin >> w >> h;

    for(int i=0;i<w;i++){
      for(int j=0;j<h;j++){
        C[i][j] = 0;
      }
    }

    if(w==0 && h==0){
      break;
    }

    int xs,ys;
    cin >> xs >> ys;

    cin >> xg >> yg;

    int n;
    cin >> n;
    int c[n],d[n],x[n],y[n];

    int cbase;

    for(int i=0;i<n;i++){
      cin >> c[i] >> d[i] >> x[i] >> y[i];

      if(x[i]==xs &&y[i]==ys){
        cbase = c[i];
      }

      if(d[i]==0 && c[i]==cbase){
        for(int j=x[i];j<x[i]+4;j++){
          for(int k=y[i];k<y[i]+2;k++){
            C[j][k]=c[i];
          }
        }
      }
      if(d[i]==1 && c[i]==cbase){
        for(int j=x[i];j<x[i]+2;j++){
          for(int k=y[i];k<y[i]+4;k++){
            C[j][k]=c[i];
          }
        }
      }
    }
    ans = 0;
    meiro(xs,ys,cbase);

    if(ans == 1){
      cout << "OK" << endl;
    }
    if(ans != 1 || c[xs][ys] == 0){
      cout << "NG" << endl;
    }
  }

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:80:25: error: invalid types 'int[int]' for array subscript
   80 |     if(ans != 1 || c[xs][ys] == 0){
      |                         ^
Language: C++

\#include <iostream>
using namespace std;
  
int F[105][105];
int xg,yg;
  
  
void DFS(int Y,int X,int c){
  if(F[Y][X] != c){
    return;
  }
  
  F[Y][X] = -2000;
  DFS(Y-1,X  ,c);
  DFS(Y  ,X+1,c);
  DFS(Y+1,X  ,c);
  DFS(Y  ,X-1,c);
}
  
  
int main(){
  int w,h,xs,ys,n;
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0)
      break;

      
    cin >> xs >> ys >> xg >> yg >> n;
    int c[n],d[n],x[n],y[n],ca;
    for(int i=0;i<n;i++){
      cin >> c[i] >> d[i] >> x[i] >> y[i];
    }
    for(int i=0;i<n;i++){
      if(c[i] == 0)
        ca = 10
      else if(i == n-1)
        c = 0:
    }
    for(int i=0; i<102; i++){
          for(int j=0; j<102; j++){
            F[i][j]=ca;
          }
    }
    for(int i=0;i<n;i++){
      if(d[i] == 0){
        for(int j=0;j<4;j++){
          F[x[i]+j][y[i]] = c[i];
          F[x[i]+j][y[i]+1] = c[i];
        }
      } else {
        for(int j=0;j<4;j++){
          F[x[i]][y[i]+j] = c[i];
          F[x[i]+1][y[i]+j] = c[i];
        }
      }
    }
 
  DFS(xs,ys,F[xs][ys]);
  
  if(F[xg][yg] == -2000){
    cout << "OK" << endl;
  } else {
    cout << "NG" <<endl;
  }
  }
}


Compiler output:
a.cc:1:1: error: stray '\' in program
    1 | \#include <iostream>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | \#include <iostream>
      |  ^
a.cc:1:3: error: 'include' does not name a type
    1 | \#include <iostream>
      |   ^~~~~~~
a.cc: In function 'int main()':
a.cc:24:5: error: 'cin' was not declared in this scope
   24 |     cin >> w >> h;
      |     ^~~
a.cc:36:16: error: expected ';' before 'else'
   36 |         ca = 10
      |                ^
      |                ;
   37 |       else if(i == n-1)
      |       ~~~~      
a.cc:62:5: error: 'cout' was not declared in this scope
   62 |     cout << "OK" << endl;
      |     ^~~~
a.cc:62:21: error: 'endl' was not declared in this scope
   62 |     cout << "OK" << endl;
      |                     ^~~~
a.cc:64:5: error: 'cout' was not declared in this scope
   64 |     cout << "NG" <<endl;
      |     ^~~~
a.cc:64:20: error: 'endl' was not declared in this scope
   64 |     cout << "NG" <<endl;
      |                    ^~~~
Language: C++

#include <iostream>
using namespace std;
  
int F[105][105];
int xg,yg;
  
  
void DFS(int Y,int X,int c){
  if(F[Y][X] != c){
    return;
  }
  
  F[Y][X] = -2000;
  DFS(Y-1,X  ,c);
  DFS(Y  ,X+1,c);
  DFS(Y+1,X  ,c);
  DFS(Y  ,X-1,c);
}
  
  
int main(){
  int w,h,xs,ys,n;
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0)
      break;

      
    cin >> xs >> ys >> xg >> yg >> n;
    int c[n],d[n],x[n],y[n],ca;
    for(int i=0;i<n;i++){
      cin >> c[i] >> d[i] >> x[i] >> y[i];
    }
    for(int i=0;i<n;i++){
      if(c[i] == 0)
        ca = 10
      else if(i == n-1)
        c = 0:
    }
    for(int i=0; i<102; i++){
          for(int j=0; j<102; j++){
            F[i][j]=ca;
          }
    }
    for(int i=0;i<n;i++){
      if(d[i] == 0){
        for(int j=0;j<4;j++){
          F[x[i]+j][y[i]] = c[i];
          F[x[i]+j][y[i]+1] = c[i];
        }
      } else {
        for(int j=0;j<4;j++){
          F[x[i]][y[i]+j] = c[i];
          F[x[i]+1][y[i]+j] = c[i];
        }
      }
    }
 
  DFS(xs,ys,F[xs][ys]);
  
  if(F[xg][yg] == -2000){
    cout << "OK" << endl;
  } else {
    cout << "NG" <<endl;
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:16: error: expected ';' before 'else'
   36 |         ca = 10
      |                ^
      |                ;
   37 |       else if(i == n-1)
      |       ~~~~
Language: C++

#include <iostream>
using namespace std;
  
int F[105][105];
int xg,yg;
  
  
void DFS(int Y,int X,int c){
  if(F[Y][X] != c){
    return;
  }
  
  F[Y][X] = -2000;
  DFS(Y-1,X  ,c);
  DFS(Y  ,X+1,c);
  DFS(Y+1,X  ,c);
  DFS(Y  ,X-1,c);
}
  
  
int main(){
  int w,h,xs,ys,n;
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0)
      break;

      
    cin >> xs >> ys >> xg >> yg >> n;
    int c[n],d[n],x[n],y[n],ca;
    for(int i=0;i<n;i++){
      cin >> c[i] >> d[i] >> x[i] >> y[i];
    }
    for(int i=0;i<n;i++){
      if(c[i] == 0)
        ca = 10;
      else if(i == n-1)
        c = 0;
    }
    for(int i=0; i<102; i++){
          for(int j=0; j<102; j++){
            F[i][j]=ca;
          }
    }
    for(int i=0;i<n;i++){
      if(d[i] == 0){
        for(int j=0;j<4;j++){
          F[x[i]+j][y[i]] = c[i];
          F[x[i]+j][y[i]+1] = c[i];
        }
      } else {
        for(int j=0;j<4;j++){
          F[x[i]][y[i]+j] = c[i];
          F[x[i]+1][y[i]+j] = c[i];
        }
      }
    }
 
  DFS(xs,ys,F[xs][ys]);
  
  if(F[xg][yg] == -2000){
    cout << "OK" << endl;
  } else {
    cout << "NG" <<endl;
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:11: error: incompatible types in assignment of 'int' to 'int [n]'
   38 |         c = 0;
      |         ~~^~~
Language: C++

#include <iostream>
using namespace std;
  
int F[105][105];
int xg,yg,w,h;
  
  
void DFS(int Y,int X,int c){
  if(F[Y][X] != c){
    return;
  }
  
  F[Y][X] = -1;
  DFS(Y+1,X  ,c);
  DFS(Y-1  ,X,c);
  DFS(Y,X+1  ,c);
  DFS(Y  ,X-1,c);
}
  
  
int main(){
  int xs,ys,n;
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0)
      break;
for(int i=0; i<105; i++){
      for(int j=0; j<105; j++){
        F[i][j] = 10;
      }
    }
      
    cin >> xs >> ys >> xg >> yg >> n;
  
  
    for(int i=0;i<n;i++){
      int c,d,x,y;
      cin >> c >> d >> x >> y;

      if(d == 0){
        for(int j=0;j<4;j++){
          F[x+j][y] = c;
          F[x+j][y+1] = c;
        }
      } else {
        for(int j=0;j<4;j++){
          F[x][y+j] = c;
          F[x+1][y+j] = c;
        }
      }
    }
  if(F[xs][ys] == 10){
cout << "NG" << endl;
continue;
  DFS(xs,ys,F[xs][ys]);
  
  if(F[xg][yg] == -1){
    cout << "OK" << endl;
  } else {
    cout << "NG" <<endl;
  }
  }
}


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

#include<iostream>
using namespace std;

char F[102][102];

void DFS(int x,int y,char c){
  if(F[x][y]!=c)
    return;
  F[x][y]='@';
  DFS(x-1,y,c);
  DFS(x,y+1,c);
  DFS(x+1,y,c);
  DFS(x,y-1,c);
}
void Block(int c,int d,int x,int y){
  char b;
  if(c=0)
    b='+';
  if(c=1)
    b='-';
  if(c=2)
    b='*';
  if(c=3)
    b='/';
  F[x][y]=b;
  F[x][y+1]=b;
  F[x+1][y]=b;
  F[x+1][y+1]=b;
  if(d==1){
    F[x][y+2]=b;
    F[x][y+3]=b;
    F[x+1][y+2]=b;
    F[x+1][y+3]=b;
  }else{
    F[x+2][y]=b;
    F[x+2][y+1]=b;
    F[x+3][y]=b;
    F[x+3][y+1]=b;
  }
}

int main(){
  int w=1,h;
  int xs,ys;
  int xg,yg;
  int n;
  int c,d,x,y;
  while(w>0){
    cin>>w>>h;
    if(w==0&&h==0)
      break;
    for(int i=0;i<w;i++){
      for(int j=0;j<h;j++){
        F[i][j]='.';
      }
    }
    cin>>xs>>ys;
    cin>>xg>>yg;
    cin>>n;
    for(int i=0;i<n;i++){
      cin>>c>>d>>x>>y;
      Block(c,d,x,y);
    }
    DFS(xs,yscout<<endl;,F[xs][ys]);
    if(F[xg][yg]=='@')
      cout<<"OK"<<endl;
    else
      cout<<"NG"<<endl;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:64:12: error: 'yscout' was not declared in this scope
   64 |     DFS(xs,yscout<<endl;,F[xs][ys]);
      |            ^~~~~~
a.cc:64:25: error: expected primary-expression before ',' token
   64 |     DFS(xs,yscout<<endl;,F[xs][ys]);
      |                         ^
Language: C++

#include<stdio.h>
#include<windows.h>
int main(void)
{
	int w,h;
	int map[101][101];
	int st[2],go[2];
	int i,j,k,l,m;
	int num;
	int b_c,b_ang,b_x,b_y;
	int sign;
	int ans;
	
	for(;;)
	{
		ans=0;
		
		for(i=0;i<100;i++)
		{
			for(j=0;j<100;j++)
				map[i][j]=0;
		}
		
		scanf("%d%d",&w,&h);
		
		if(w==0 && h==0)
			break;
		
		scanf("%d%d%d%d",&st[0],&st[1],&go[0],&go[1]);
		
		
		scanf("%d",&num);
		
		for(i=0;i<num;i++)
		{
			scanf("%d%d%d%d",&b_c,&b_ang,&b_x,&b_y);
			
			if(b_ang==0)
			{
				for(j=0;j<4;j++)
				{
					for(k=0;k<2;k++)
						map[b_x+j][b_y+k]=b_c;
				}
			}
			else
			{
				for(j=0;j<4;j++)
				{
					for(k=0;k<2;k++)
						map[b_x+k][b_y+j]=b_c;
				}
			}
		}
		
		if(map[st[0]][st[1]]==0 || map[go[0]][go[1]]==0)
			printf("NG");
		else
		{
			sign=map[st[0]][st[1]];
			
			for(i=0;i<w;i++)
			{
				for(j=0;j<h;j++)
				{
					if(map[i][j]!=sign)
						map[i][j]=0;
				}
			}
			
			map[st[0]][st[1]]=-1;
			map[go[0]][go[1]]=-2;
			
			for(i=st[0],j=st[1];;)
			{
				
/*				for(l=0;l<h;l++)
				{
					for(m=0;m<w;m++)
					{
						printf("%d ",map[l][m]);
					}
					printf("%dツ行\n",l);
				}
				getchar();
				system("cls");
*/
				
				if(map[i+1][j]==-2 || map[i][j+1]==-2 || map[i-1][j]==-2 || map[i][j-1]==-2)
				{
					ans=1;
					break;
				}
				else if(map[i-1][j]!=0 && map[i][j-1]!=0 && map[i+1][j]!=0 && map[i][j+1]!=0)
				{
					if(map[i+1][j]==sign)
					{
						map[i][j]=7;
						i++;
					}
					else if(map[i][j+1]==sign)
					{
						map[i][j]=7;
						j++;
					}
					else if(map[i-1][j]==sign)
					{
						map[i][j]=7;
						i--;
					}
					else if(map[i][j-1]==sign)
					{
						map[i][j]=7;
						j--;
					}
				}
				else if(map[i+1][j]==sign/* && map[i][j-1]!=sign*/)//ツ右
				{
//					printf("migi\n");
					map[i][j]=7;
					i++;
				}
				else if(/*map[i+1][j]!=sign && */map[i][j+1]==sign)//ツ可コ
				{
//					printf("sita1\n");
					map[i][j]=7;
					j++;
				}
				else if(map[i-1][j]==sign/* && map[i][j+1]!=sign*/)//ツ債カ
				{
//					printf("hidari\n");
					map[i][j]=7;
					i--;
				}
				else if(/*map[i+1][j]!=sign && */map[i][j-1]==sign)//ツ湘」
				{
//					printf("ue1\n");
					map[i][j]=7;
					j--;
				}
				else if(/*map[i-1][j]!=sign && */map[i][j+1]==sign)//ツ可コ
				{
//					printf("sita2\n");
					map[i][j]=7;
					j++;
				}
				else if(map[i-1][j]!=sign && map[i][j-1]==sign)//ツ湘」
				{
//					printf("ue2\n");
					map[i][j]=7;
					j--;
				}
				else if(map[i+1][j]!=sign && map[i][j+1]!=sign && map[i-1][j]!=sign && map[i][j-1]!=sign)
				{
					ans=2;
					break;
				}
			}
			if(ans==1)
				printf("OK");
			else if(ans==2)
				printf("NG");
		}
	}
}

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

#include<iostream>

bool flag;
int n,sx,sy,gx,gy,col;

void erase(int** field){
	for(int i=0; i<102; i++)
		for(int j=0; j<102; j++)
			field[i][j] = 0;
}

void DFS(int x, int y, int** field){
	int xx = x+1;
	int yy = y;

	if(xx == gx && yy == gy){
		flag = true;
		return;
	}

	if(field[yy][xx] == col)
		DFS(xx, yy, field);
	if(flag)
		return;

	xx = x;
	yy = y+1;
	if(field[yy][xx] == col)
		DFS(xx, yy, field);
	if(flag)
		return;

	xx = x-1;
	yy = y;
	if(field[yy][xx] == col)
		DFS(xx, yy, field);
	if(flag)
		return;
			
	xx = x;
	yy = y-1;
	if(field[yy][xx] == col)
		DFS(xx, yy, field);
}

int main(){
	int field[102][102];//y,x
	int c,d,bx,by;
	using std::cin;
	while(true){
		flag = false;
		erase(field);
		cin >> c >> d;
		if(!c && !d)
			return 0;
		cin >> sx >> sy;
		cin >> gx >> gy;
		cin >> n;
		for(int i=0; i<n; i++){
			cin >> c >> d >> bx >> by;
			if(d==0){
				for(int h=by; h<by+2; h++)
					for(int k=bx; k<bx+4; k++)
						field[h][k] = c;
			}
			else{
				for(int h=by; h<by+4; h++)
					for(int k=bx; k<bx+2; k++)
						field[h][k] = c;
			}
		}
		col = field[gy][gx];
		DFS(sx, sy, field);
		if(flag)
			std::cout << "OK\n";
		else
			std::cout << "NG\n";
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:23: error: cannot convert 'int (*)[102]' to 'int**'
   52 |                 erase(field);
      |                       ^~~~~
      |                       |
      |                       int (*)[102]
a.cc:6:18: note:   initializing argument 1 of 'void erase(int**)'
    6 | void erase(int** field){
      |            ~~~~~~^~~~~
a.cc:73:29: error: cannot convert 'int (*)[102]' to 'int**'
   73 |                 DFS(sx, sy, field);
      |                             ^~~~~
      |                             |
      |                             int (*)[102]
a.cc:12:30: note:   initializing argument 3 of 'void DFS(int, int, int**)'
   12 | void DFS(int x, int y, int** field){
      |                        ~~~~~~^~~~~
Language: C++

#include<iostream>

int field[102][102];//y,x
bool flag;
int sx,sy,gx,gy,col;

void erase(){
	for(int i=0; i<102; i++)
		for(int j=0; j<102; j++)
			field[i][j] = 0;
}

void DFS(int x, int y){
	if(sx < gy)
		DFSr(x,y);
	else
		DFSl(x,y);
}

void DFSr(int x, int y){
	if(field[y][x] != col)
		return;
	if(x == gx && y == gy){
		flag = true;
		return;
	}
	DFSr(x+1, y);
	if(flag)
		return;
	DFSr(x, y+1);
	if(flag)
		return;
	DFSr(x, y-1);
	if(flag)
		return;
	DFSr(x-1, y);
}

void DFSl(int x, int y){
	if(field[y][x] != col)
		return;
	if(x == gx && y == gy){
		flag = true;
		return;
	}
	DFSl(x-1, y);
	if(flag)
		return;
	DFSl(x, y+1);
	if(flag)
		return;
	DFSl(x, y-1);
	if(flag)
		return;
	DFSl(x+1, y);
}

int main(){
	int n,c,d,bx,by;
	while(true){
		flag = false;
		erase();

		std::cin >> c >> d;
		if(!c && !d)
			return 0;

		std::cin >> sx >> sy;
		std::cin >> gx >> gy;

		std::cin >> n;
		for(int i=0; i<n; i++){
			std::cin >> c >> d >> bx >> by;
			if(d==0)
				for(int h=by; h<by+2; h++)
					for(int w=bx; w<bx+4; w++)
						field[h][w] = c;
			else
				for(int h=by; h<by+4; h++)
					for(int w=bx; w<bx+2; w++)
						field[h][w] = c;
		}

		col = field[gy][gx];
		DFS(sx, sy);
		if(flag)
			std::cout << "OK\n";
		else
			std::cout << "NG\n";
	}
}

Compiler output:
a.cc: In function 'void DFS(int, int)':
a.cc:15:17: error: 'DFSr' was not declared in this scope; did you mean 'DFS'?
   15 |                 DFSr(x,y);
      |                 ^~~~
      |                 DFS
a.cc:17:17: error: 'DFSl' was not declared in this scope; did you mean 'DFS'?
   17 |                 DFSl(x,y);
      |                 ^~~~
      |                 DFS
Language: C++

#include <iostream>
int m[101][101];
int w,h,r,gx,gy;
void dfs(int x,int y,int c){
	if(!(x-gx)&&!(y-gy))r=1;
	if(x>0&&m[x-1][y]==c)m[x-1][y]=0,dfs(x-1,y,c);
	if(x<w&&m[x+1][y]==c)m[x+1][y]=0,dfs(x+1,y,c);
	if(y>0&&m[x][y-1]==c)m[x][y-1]=0,dfs(x,y-1,c);
	if(y<h&&m[x][y+1]==c)m[x][y+1]=0,dfs(x,y+1,c);
	return ;
}

int main(){
	//whÍ{[hÌå«³AnÍubNÌÂ
	int n,c,d,sx,sy,bx,by;
	//spÍX^[gn_ÌÀWAgpÍS[n_ÌÀW
	point sp,bp;
	
	while(std::cin>>w>>h,w&&h){
		for(int y=0;y<101;y++){
			for(int x=0;x<101;x++){
				m[x][y] = 0;
			}
		}
		r=0;
		std::cin>>sx>>sy;
		std::cin>>gx>>gy;
		std::cin>>n;
		for(int i=0;i<n;i++){
			std::cin>>c>>d>>bx>>by;
			int bw,bh;
			d?bw=2,bh=4:bh=2,bw=4;
			for(int y=by;y<=by+bh;y++){
				for(int x=bx;x<=bx+bw;x++){
					m[x][y] = c;
				}
			}
		}
		if(m[sx][sy])dfs(sx,sy,m[sx][sy]),m[sx][sy] = 0;
		if(r)std::cout<<"OK"<<std::endl;
		else{std::cout<<"NG"<<std::endl;}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'point' was not declared in this scope
   17 |         point sp,bp;
      |         ^~~~~
Language: C++

#include<stdio.h>
#include<string.h>
int gx,gy,m[128][128];
int F(int x,int y,int c)
{
	if(x==gx&&y==gy)
		return 1;
	if(m[y][x]!=c)
		return 0;
	m[y][x]=-c;
	int d[]={0,1,0,-1,0},i,f;
	for(i=f=0;i<4;++i)
		f=f||F(x+d[i],y+d[i+1],c);
	return f;
}
int main()
{
	int w,h,sx,sy,x,y,n,c,d,i,j;
	while(scanf("%d%d",&w,&h),w)
	{
		memset(m,0,sizeof(m));
		scanf("%d%d%d%d%d",&sx,&sy,&gx,&gy,&n);
		while(n--)
		{
			scanf("%d%d%d%d",&c,&d,&x,&y);
			for(i=0;i<2;++i)for(j=0;j<4;++j)
				if(d) m[y+j][x+i]=c;
				else m[y+i][x+j]=c;
		}j<=w;++j)printf("%c",".@#$%*"[m[i][j]]);
		if(1<=sx&&sx<=w&&1<=sy&&sy<=h&&m[sy][sx]&&F(sx,sy,m[sy][sx]))puts("YES");
		else puts("NO");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: expected ';' before ')' token
   29 |                 }j<=w;++j)printf("%c",".@#$%*"[m[i][j]]);
      |                          ^
      |                          ;
Language: C++

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


#define rep(i,n) for(int i = 0; i < n; i++)
#define MAX 50

int dx[] = {0,0,-1,1},
	dy[] = {1,-1,0,0};

typedef pair<int,int> P;
P S,G;
int w,h;
int maze[MAX][MAX];
int color;

bool check()
{
	queue<P> que;
	que.push(S);
	color = maze[S.second][S.first];

	int nx,ny;
	while(que.size()){
		P p = que.front();	que.pop();

		if(p == G)
			return true;

		rep(i,4){
			nx = p.first + dx[i], ny = p.second + dy[i];
			
			if(nx > -1 && ny > -1 && nx < w && ny < h &&
				maze[ny][nx] == color){
					maze[ny][nx] = -1;
					que.push(P(nx,ny));
			}

		}
	}


	
	return false;
}

int main(void)
{
	int n,c,d,x,y;

	while(cin >> w >> h, w){
		cin >> S.first >> S.second;
		cin >> G.first >> G.second;
		S.first = S.first / 2;
		S.second= S.second/ 2;

		cin >> n;

		rep(i,n){
			cin >> c >> d >> x >> y;
			x /= 2;
			y /= 2;
			x++;
			y++;

			if(d == 0)
				maze[y][x] = maze[y][x+1] = c;
			else
				maze[y][x] = maze[y+1][x] = c;
		}
		
		if(check())
			printf("OK\n");
		else
			printf("NG\n");
/*
		rep(i,y){
			rep(j,x)
				printf("%2d", maze[i][j]);
			cout << endl;
		}
	}
	*/
	return 0;
}

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

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


#define rep(i,n) for(short i = 0; i < n; i++)
#define MAX 50

int dx[] = {0,0,-1,1},
	dy[] = {1,-1,0,0};

typedef pair<short,short> P;
P S,G;
short w,h;

short color;
	queue<P> que;
	que.push(S);
bool check(short maze[MAX][MAX])
{
	

	color = maze[S.second][S.first];

	short nx,ny;
	while(que.size()){
		P p = que.front();	que.pop();

		if(p == G){
			while(que.size())
				que.pop();
			return true;
		}

		rep(i,4){
			nx = p.first + dx[i], ny = p.second + dy[i];
			
			if(nx > -1 && ny > -1 && nx < w && ny < h &&
				maze[ny][nx] == color){
					maze[ny][nx] = -1;
					que.push(P(nx,ny));
			}

		}
	}


	
	return false;
}

int main(void)
{
	short n,c,d,x,y;
	short maze[MAX][MAX];
	while(cin >> w >> h, w){
		cin >> S.first >> S.second;
		cin >> G.first >> G.second;
		S.first = S.first / 2;
		S.second= S.second/ 2;

		cin >> n;

		rep(i,n){
			cin >> c >> d >> x >> y;
			x /= 2;
			y /= 2;
			x++;
			y++;

			if(d == 0)
				maze[y][x] = maze[y][x+1] = c;
			else
				maze[y][x] = maze[y+1][x] = c;
		}
		
		if(maze[S.second][S.first] == maze[G.second][G.first] && check(maze))
			cout << "OK\n";
		else
			cout << "NG\n";

	}
	
	return 0;
}

Compiler output:
a.cc:18:9: error: 'que' does not name a type
   18 |         que.push(S);
      |         ^~~
Language: C++

#include<iostream> #include<string> #include<string.h> #include<cstring> #include<cmath> #include<algorithm> #include<stdlib.h> #include<queue> #include<map> #include<vector> #include<list> #include<stack> #include<functional>

using namespace std;

#define all(c) (c).begin(), (c).end() #define rep(i,n) for(int i=0;i<n;i++)

typedef unsigned long long ull; typedef long long ll;

const int INF=100000000; int dx[4]={1,0,-1,0}; int dy[4]={0,1,0-1};

typedef pair<int ,int > P;

char maze[105][105];

int sx,sy; int gx,gy; int w,h;

char sc; //スタート地点のカラー

//stdin //stdout

void dfs(int x,int y) { maze[x][y]='9';

for(int i=-1;i<=1;i++) { for(int j=-1;j<=1;j++) { int nx=x+i; int ny=y+j;

if(0<=nx && nx<=w && 0<=ny && ny<=h &&maze[nx][ny] != '0'&&maze[nx][ny] != '9') { dfs(nx,ny); }

} } return ; }

void solve() {

rep(i,101) rep(j,101) maze[i][j]='0';

int n; char c; int d; int x,y;

cin>>sy>>sx; cin>>gy>>gx;

cin>>n;

rep(i,n) { cin>>c>>d>>y>>x;

if(d==1) { rep(i,4) { rep(j,2) { maze[x+i][y+j]=c;

} } } else if (d==0) { rep(i,2) { rep(j,4) { maze[x+i][y+j]=c;

} } }

} //6 6 //1 1 //3 6 //2 //1 0 1 1 //1 1 3 3 // rep(i,w+1) // { // rep(j,h+1) // { // cout<<maze[i][j]; //// } // cout<<endl; // } //// cout<<maze[gx][gy]<<endl;

if(maze[sx][sy]=='0') { cout<<"NG"<<endl; return; } else { sc=maze[sx][sy]; dfs(sx,sy); }

//rep(i,w+1) //{ // rep(j,h+1) // { // cout<<maze[i][j];

// } // cout<<endl; //}

if(maze[gx][gy]=='9') { cout<<"OK"<<endl; return; } else { cout<<"NG"<<endl; return; }

}

int main() {

while(cin>>w>>h) { if(w==0 && h==0) { return 0; } else { solve(); } }

return 0; }

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include<iostream> #include<string> #include<string.h> #include<cstring> #include<cmath> #include<algorithm> #include<stdlib.h> #include<queue> #include<map> #include<vector> #include<list> #include<stack> #include<functional>
      |                    ^
a.cc:5:14: error: '#' is not followed by a macro parameter
    5 | #define all(c) (c).begin(), (c).end() #define rep(i,n) for(int i=0;i<n;i++)
      |              ^
a.cc: In function 'void solve()':
a.cc:31:5: error: 'i' was not declared in this scope
   31 | rep(i,101) rep(j,101) maze[i][j]='0';
      |     ^
a.cc:31:1: error: 'rep' was not declared in this scope
   31 | rep(i,101) rep(j,101) maze[i][j]='0';
      | ^~~
Language: C++

int  map[100][100];
bool visited[100][100];
int  w,h;
int  xs,ys;
int  xg,yg;
int  n;

int dfs(int x,int y) {
	static int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
	if(x==xg&&y==yg) return 1;
	visited[x][y]=true;
	for(int i=0;i<4;i++) {
		int nx=x+dx[i],ny=y+dy[i];
		if(0<=nx&&nx<w&&0<=ny&&ny<h&&map[x][y]==map[nx][ny]&&!visited[nx][ny]) {
			if(dfs(nx,ny)) return 1;
		}
	}
	return 0;
}

int main() {
	int c,d,x,y;

	while(1) {
		memset(map,0,sizeof(map));
		memset(visited,0,sizeof(visited));
		scanf("%d %d",&w,&h);
		if(w==0&&h==0) break;
		scanf("%d %d",&xs,&ys);xs--;ys--;
		scanf("%d %d",&xg,&yg);xg--;yg--;
		scanf("%d",&n);
		for(int i=0;i<n;i++) {
			scanf("%d %d %d %d",&c,&d,&x,&y);x--;y--;
			int X,Y;
			if(d==1) {
				X=2;Y=4;
			}else {
				X=4;Y=2;
			}
			for(int j=0;j<X;j++) {
				for(int k=0;k<Y;k++) {
					map[x+j][y+k]=c;
				}
			}
		}
		printf("%s\n",dfs(xs,ys)?"OK":"NG");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'memset' was not declared in this scope
   25 |                 memset(map,0,sizeof(map));
      |                 ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | int  map[100][100];
a.cc:27:17: error: 'scanf' was not declared in this scope
   27 |                 scanf("%d %d",&w,&h);
      |                 ^~~~~
a.cc:46:17: error: 'printf' was not declared in this scope
   46 |                 printf("%s\n",dfs(xs,ys)?"OK":"NG");
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int  map[100][100];
Language: C++

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

int w,h,sx,sy,gx,gy;
int mas[101][101],used[101][101];
int dx[] = {0,1,0,-1},dy[] = {1,0,-1,0};

void make_map(int x,int y,int chk,int color){
  if(chk == 0){
    for(int i=y;i<y+2;i++){
      for(int j=x;j<x+4;j++) mas[i][j] = color;
    }
  }
  else {
    for(int i=y;i<y+4;i++){
      for(int j=x;j<x+2;j++) mas[i][j] = color;
    }
  }
}

bool dfs(int x,int y){
  used[y][x] = true;
  if(x == gx && y == gy) return true;
  for(int i=0;i<4;i++){
    int nx = x + dx[i];
    int ny = y + dy[i];
    if(nx >= 0 && nx < w && ny >= 0 && ny < h && mas[ny][nx] == mas[sy][sx] && !used[ny][nx]) dfs(nx,ny);
  }
  return used[gy][gx];
}

int main(){
  int n;
  while(cin >> w >> h,w||h){
    fill_n(mas[0],101*101,0);
    memset(used,false,sizeof(used));
    cin >> sx >> sy >> gx >> gy >> n;
    --sx; --sy; --gx; --gy;
    while(n--){
      int c,d,x,y; cin >> c >> d >> x >> y; --x; --y;
      make_map(x,y,d,c);
    }
    cout << (dfs(sx,sy)? "OK" : "NG") << endl;
  }
}

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

#include<iostream>
using namespace std;
int a[200][200]={},sx,sy,gx,gy;
int f(int i,int j){
	if(i==gy && j==gx)
		return 1;
	if(a[i+1][j]==a[sy][sx])
		if(f(i+1,j)==1)
			return 1;
	if(a[i][j+1]==a[sy][sx])
		if(f(i,j+1)==1)
			return 1;
	if(a[i-1][j]==a[sx][sy])
		if(f(i-1,j)==1)
			return 1;
	if(a[i][j-1]==a[sx][sy])
		if(f(i,j-1)==1)
			return 1;
	return 0;
}
int main(){
	while(1){
		int w,h,n,c,d,x,y;
		cin>>w>>h;
		if(w==0 && h==0)
		break;
		for(int i=0;i<h;i++)
		for(int j=0;j<w;j++)
			a[i][j]=0;
		cin>>sx>>sy;
		cin>>gx>>gy;
		cin>>n;
		for(int i=0;i<n;i++){
			cin>>c>>d>>x>>y;
			if(d==0){
				for(int i=0;i<2;i++)
				for(int j=0;j<4;j++)
					a[y+i][x+j]=c;
			}
			if(d==1){
				for(int i=0;i<4;i++)
				for(int j=0;j<2;j++)
					a[y+i][x+j]=c;
			}
		}
		if(a[sx][sy]!=a[gx][gy])
		cout<<"NG"<<endl;
		else if(f(sy,sx)==0)
		cout<<"NG"<<endl;
		else if(f(sx,sy)==1)
		cout<<"OK"<<endl;
	}
	return 0;
}
+-

Compiler output:
a.cc:55:1: error: expected unqualified-id before '+' token
   55 | +-
      | ^
Language: Java

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

public class Main2 {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while(true){
			line = br.readLine();
			int num = Integer.valueOf(line);
			if(num == 0){
				break;
			}
			System.out.println(getNewNum2(num));
		}
	}
	
/*	private static long getNewNum(int target){
		long cnt = 0;
		for(long i = 1; ; i++){
			String str = String.valueOf(i + cnt);
			if(str.contains("4") || str.contains("6")){
				cnt++;
				continue;
			}
			if(i == target){
				return i + cnt;
			}
		}
	}*/
	
	private static long getNewNum2(int target){
		int[] tb = {0, 1, 2, 3, 5, 7, 8, 9};
		String str = Integer.toOctalString(target);
		
		String result = "";
		for(String s : str.split("")){
			int i = Integer.parseInt(s);
			result = result + tb[i];
		}
		
		return Long.parseLong(result);
	}
}

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.BufferedReader;
import java.io.InputStreamReader;

public class Main2 {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while(true){
			line = br.readLine();
			int num = Integer.valueOf(line);
			if(num == 0){
				break;
			}
			System.out.println(getNewNum2(num));
		}
	}

	private static long getNewNum2(int target){
		int[] tb = {0, 1, 2, 3, 5, 7, 8, 9};
		String str = Integer.toOctalString(target);
		
		String result = "";
		for(String s : str.split("")){
			int i = Integer.parseInt(s);
			result = result + tb[i];
		}
		
		return Long.parseLong(result);
	}
}

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

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

#define MAX (9358757000)

int main(void)
{
	int i, j, k;
	unsigned long long int num[10000000000];
	int n;
	int flag;
	int temp
	
	memset(j, 0, sizeof(j))
	k = 1;
	
	for(j = 0; j < 1000000000; j++){
		flag = 0;
		j = temp
		while (temp /= 10 != 0){
			if (j % 4 == 0){
				k++;
				break;
			}
			else if(j % 6 == 0){
				k++;
				break;
			}
		}
			num[j] = k;
			k++;
	}
	
	while (1){
		scanf("%d", &n);
		
		if(n == 0){
			break;
		}
		
		printf("%u\n", num[n - 1]);
	}

Compiler output:
main.c: In function 'main':
main.c:14:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'memset'
   14 |         memset(j, 0, sizeof(j))
      |         ^~~~~~
main.c:14:16: error: passing argument 1 of 'memset' makes pointer from integer without a cast [-Wint-conversion]
   14 |         memset(j, 0, sizeof(j))
      |                ^
      |                |
      |                int
In file included from main.c:2:
/usr/include/string.h:61:28: note: expected 'void *' but argument is of type 'int'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                      ~~~~~~^~~
main.c:14:32: error: expected ';' before 'k'
   14 |         memset(j, 0, sizeof(j))
      |                                ^
      |                                ;
   15 |         k = 1;
      |         ~                       
main.c:19:21: error: 'temp' undeclared (first use in this function)
   19 |                 j = temp
      |                     ^~~~
main.c:19:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:25: error: expected ';' before 'while'
   19 |                 j = temp
      |                         ^
      |                         ;
   20 |                 while (temp /= 10 != 0){
      |                 ~~~~~    
main.c:42:9: error: expected declaration or statement at end of input
   42 |         }
      |         ^
Language: C

main()
{
	int n;
	while (scanf("%d", &n), n)
	{
		int t[10], d;
		for (d = 0; n; ++d, n /= 8)
			t[d] = n % 8;
		for (int i = d-1; i >= 0; --i)
			printf("%d", t[i] >= 5 ? t[i]+2 : t[i] == 4 ? t[i]+1 : t[i]);
		printf("\n");
	}

	return 0;
}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main()
      | ^~~~
main.c: In function 'main':
main.c:4:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         while (scanf("%d", &n), n)
      |                ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main()
main.c:4:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         while (scanf("%d", &n), n)
      |                ^~~~~
main.c:4:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   10 |                         printf("%d", t[i] >= 5 ? t[i]+2 : t[i] == 4 ? t[i]+1 : t[i]);
      |                         ^~~~~~
main.c:10:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   11 |                 printf("\n");
      |                 ^~~~~~
main.c:11:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>

int main(){
	int i,j,b[10],f=0,c=0;
	long a[10],num;
	a[0]=1;
	for(i=1;i<10;i++){
		a[i]=a[i-1]*8;
	}
	for(i=0;i<10;i++){
		b[i]=0;
	}
	for(;;){
		scanf("%ld",&num);
		if(num==0){
			break;
		}
		for(i=9;i>=0;i--){
			while(f==0){
				if(num>=a[i]){
					num-=a[i];
					c++;	
				}else{
					b[i]=c;
					c=0;
					f=1;
				}
			}
			f=0;
		}
		f=0;
		i=9;
		while(f==0){
			if(b[i]!=0){
				f=1;
				j=i;
			}
			i--;
		}
		for(i=j;i>=0;i--){              
			if(b[i]==4){
				b[i]+=1;
				printf("%d",b[i]);
			}else if(b[i]>=5){
				b[i]+=2;
				printf("%d",b[i]);
			}else{
				printf("%d",b[i]);
			}
		}
		printf("\n");
	}
　　　　　return 0;
}

Compiler output:
main.c: In function 'main':
main.c:53:1: error: stray '\343' in program
   53 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      | ^~~~~~~~
main.c:53:3: error: stray '\343' in program
   53 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |         ^~~~~~~~
main.c:53:5: error: stray '\343' in program
   53 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                 ^~~~~~~~
main.c:53:7: error: stray '\343' in program
   53 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                         ^~~~~~~~
main.c:53:9: error: stray '\343' in program
   53 | <U+3000><U+3000><U+3000><U+3000><U+3000>return 0;
      |                                 ^~~~~~~~
Language: C++

#include <iostream>
#include <cstdlib>

using namespace std;

int main(void)
{
	// itoa
	int n;
	while (cin >> n, n){
		char s[20];
		itoa(n, s, 8);
		
		string str = s;
		for (int i = 0; i < str.length(); i++){
			if ('4' <= str[i]) str[i]++;
			if ('6' <= str[i]) str[i]++;
		}
		cout << str << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'itoa' was not declared in this scope
   12 |                 itoa(n, s, 8);
      |                 ^~~~
Language: C++

#include <iostream>
#include <cstdlib>

using namespace std;

int main(void)
{
	// itoa
	int n;
	while (cin >> n, n){
		char s[20];
		_itoa(n, s, 8);
		
		string str = s;
		for (int i = 0; i < str.length(); i++){
			if ('4' <= str[i]) str[i]++;
			if ('6' <= str[i]) str[i]++;
		}
		cout << str << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: '_itoa' was not declared in this scope
   12 |                 _itoa(n, s, 8);
      |                 ^~~~~
Language: C++

#include<iostream>
using namespace std;

int main(void){
  int num[] = {1,2,3,5,6,7,8,9};
  int n;
  while(cin>>n,n){
    long long a=0,d=1;
    while(n){
      a+=nums[n%8]*d;
      d*=10;
      n/=8;
    }	
    cout<<a<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'nums' was not declared in this scope; did you mean 'num'?
   10 |       a+=nums[n%8]*d;
      |          ^~~~
      |          num
Language: C++

#include <iostream>

using namespace std;


int main(){
    long ans=0;
    int c=0;
    int n;
    while(cin>>n){
        ans+=n%8*pow(10,c);
        n/=8;
        if(n==0)break;
        c++;
    }
    for(int i=0;i<=c;i++){
        int temp=((long)(ans/pow(10,i))%10);
        if(temp==4)ans+=pow(10,i);
        if(temp>=5)ans+=2*pow(10,i);
    }
    cout<<ans<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: 'pow' was not declared in this scope
   11 |         ans+=n%8*pow(10,c);
      |                  ^~~
a.cc:17:30: error: 'pow' was not declared in this scope
   17 |         int temp=((long)(ans/pow(10,i))%10);
      |                              ^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	long long ans;
	int i,k,n,o[10];
	for (i=1,o[0]=1;i<10;i++) o[i]=o[i-1]*8;
	while(cin >> n && n>0) {
	ans=0;	
	for (i=9;i>=0;i--) {
		if (n>=o[i]) { k=n / o[i]; n=n % o[i];
		               if (k==4) k=5; else  if (k>4) k+=2;
		               ans+=k;
		                }
		if (i>0) ans=ans*10;
		}
	cout << ans << endl; 		   
}

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

#include <stdio.h>
 
int main(void) {
	int i;
char ans[10];
while(scanf("%d",&i),i){
sprintf(a,"%o",i);
for(i=0;i<10;i++){
if(ans[i]>=4) ans[i]++;
if(ans[i]>=6) ans[i]++;
}
printf("%s\n",ans);
}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'a' was not declared in this scope
    7 | sprintf(a,"%o",i);
      |         ^
Language: C++

#include <stdio.h>
 
int main(void) {
	int i;
char ans[10];
while(scanf("%d",&i),i){
sprintf(ans,"%o",i);
for(i=0;i<10;i++){
if(ans[i]>=4) ans[i]++;
if(ans[i]>=6) ans[i]++;
if(ans[i]==0) break
}
printf("%s\n",ans);
}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: expected ';' before '}' token
   11 | if(ans[i]==0) break
      |                    ^
      |                    ;
   12 | }
      | ~
Language: C++

#include <stdio.h>
 
int main(void) {
	int i;
char ans[10];
while(scanf("%d",&i),i){
sprintf(ans,"%o",i);
for(i=0;i<10;i++){
if(ans[i]==0) break

if(ans[i]>=4) ans[i]++;
if(ans[i]>=6) ans[i]++;

}
printf("%s\n",ans);
}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before 'if'
    9 | if(ans[i]==0) break
      |                    ^
      |                    ;
   10 | 
   11 | if(ans[i]>=4) ans[i]++;
      | ~~
Language: C++


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


class Main{
	public static void main(String[] args){
		Solve s = new Solve();
		s.solve();
	}	
}

class Solve{
	Solve(){}
	
	Scanner in = new Scanner(System.in);

	void solve(){

		while(in.hasNext()){
			int n = in.nextInt();
			if(n == 0) return;
			System.out.println(toOct(n));
		}
		
	}

	String toOct(int n) {
		if(n == 0) return new String("0");
		StringBuilder ret = new StringBuilder();
		while(n > 0){
			int m = n % 8;
			if(m >= 4) m++;
			if(m > 5) m++;
			ret.append((char)('0' + m));
			n /= 8;
		}
		ret.reverse();
		return ret.toString();
	}

}

Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.ArrayList;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.Stack;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:15: error: expected ':' before 'static'
    8 |         public static void main(String[] args){
      |               ^~~~~~~
      |               :
a.cc:8:33: error: 'String' has not been declared
    8 |         public static void main(String[] args){
      |                                 ^~~~~~
a.cc:8:42: error: expected ',' or '...' before 'args'
    8 |         public static void main(String[] args){
      |                                          ^~~~
a.cc:12:2: error: expected ';' after class definition
   12 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:9:17: error: 'Solve' was not declared in this scope
    9 |                 Solve s = new Solve();
      |                 ^~~~~
a.cc:10:17: error: 's' was not declared in this scope
   10 |                 s.solve();
      |                 ^
a.cc: At global scope:
a.cc:17:9: error: 'Scanner' does not name a type
   17 |         Scanner in = new Scanner(System.in);
      |         ^~~~~~~
a.cc:29:9: error: 'String' does not name a type
   29 |         String toOct(int n) {
      |         ^~~~~~
a.cc:43:2: error: expected ';' after class definition
   43 | }
      |  ^
      |  ;
a.cc: In member function 'void Solve::solve()':
a.cc:21:23: error: 'in' was not declared in this scope; did you mean 'int'?
   21 |                 while(in.hasNext()){
      |                       ^~
      |                       int
a.cc:24:25: error: 'System' was not declared in this scope
   24 |                         System.out.println(toOct(n));
      |                         ^~~~~~
a.cc:24:44: error: 'toOct' was not declared in this scope
   24 |                         System.out.println(toOct(n));
      |                                            ^~~~~
Language: C++

#include<iostream>
using namespace std;
int main() {
	long long a[10], c = 1, d, e = 0;
	int b = 0;
	while (c <= 1000000000) {
		a[b] = c;
		b++;
		c *= 8;
	}
	while (cin >> d&&d != 0) {
		e = 0;
		int f = 0;
		for (int i = b-1; i >= 0; i--) {
			f = 0;
			if (a[i] <= d) {
				while (a[i] <= d) {
					f++;
					d -= a[i];
				}
				if (f <= 3)
					e += (pow(10, i)*f);
				else if (f == 5)
					e += (pow(10, i)*(f + 2));
				else if (f < 6)
					e += (pow(10, i)*(f + 1));
				else if(f>=6)
					e += (pow(10, i)*(f + 2));
			}
		}
		cout << e << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:47: error: 'pow' was not declared in this scope
   22 |                                         e += (pow(10, i)*f);
      |                                               ^~~
a.cc:24:47: error: 'pow' was not declared in this scope
   24 |                                         e += (pow(10, i)*(f + 2));
      |                                               ^~~
a.cc:26:47: error: 'pow' was not declared in this scope
   26 |                                         e += (pow(10, i)*(f + 1));
      |                                               ^~~
a.cc:28:47: error: 'pow' was not declared in this scope
   28 |                                         e += (pow(10, i)*(f + 2));
      |                                               ^~~