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

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

int main(void)
{
    int H,W;
    cin>> H >> W;
    char s[H][W],m[H][W];
    for (int i=0;i<H; ++i){
        for (int j=0; j<W; ++j){
             cin>>s[i][j];
        }
    }
    for (int i=0; i<H; ++i){
        for (int j=0; j<W; ++j){

            if (s[i][j]=='.'){
                int count = 0;
                int k=i-1,l=j-1;
                for (k<=i+1; ++k){
                    for (l<=j+1; ++l){
                            if (s[k][l]=='#') count += 1;
                    }
               }
                cout << count;
            }

            else cout << '#';
        }
        cout << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:33: error: expected ';' before ')' token
   22 |                 for (k<=i+1; ++k){
      |                                 ^
      |                                 ;
a.cc:23:37: error: expected ';' before ')' token
   23 |                     for (l<=j+1; ++l){
      |                                     ^
      |                                     ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

const int oo=-10;//优化：定义常量oo小于-8，给有雷的格子标注，这样的话无论下面怎样加也不会大于0
int n,m,a[52][52];
char c;

int main()
{
    cin>>n>>m;//读入
    for(int i=1;i<=n;i++)//从1开始，有0行0列作围墙
        for(int j=1;j<=m;j++)
        {
            cin>>c;//一个一个读入矩阵的各个字符
            if(c=='#')//如果有雷
            {
                a[i][j]=oo;//标注出雷格
                a[i-1][j-1]++;//以下八行给雷格的周围的所有格子的雷数加一
                a[i-1][j]++;
                a[i-1][j+1]++;
                a[i][j-1]++;
                a[i][j+1]++;
                a[i+1][j-1]++;
                a[i+1][j]++;
                a[i+1][j+1]++;
            }
        }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
            if(a[i][j]<0)cout<<"#";//标注的用处：如果小于0就是有雷的格子
            else cout<<a[i][j];//否则输出雷数
        cout<<endl；//省去了死亡换行的困扰
    }   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:15: error: 'endl\U0000ff1b' was not declared in this scope
   33 |         cout<<endl；//省去了死亡换行的困扰
      |               ^~~~~~
Language: C++

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

int main() {
	int h,w;
	std::cin >> h >> w;
	bool bomb[50][50] = {0};  
	

	for (int i = 1; i <= h; ++i) {

		std::string s;
		std::cin >> s;
		for (int j = 1; j <= w; ++j) {
			if (s[j] == '.') bomb[i][j] = 0;
			else bomb[i][j] = 1;
		}
	}
	
	for (int i = 1; i <= h; ++i) {
		for (int j = 1; j <= w; ++j) {
			if (!bomb) {
				int count = 0;
				if (bomb[i - 1][j - 1])count++;
				if (bomb[i - 1][j])count++;
				if (bomb[i - 1][j + 1])count++;
				if (bomb[i][j - 1])count++;
				if (bomb[i][j])count++;
				if (bomb[i][j + 1])count++;
				if (bomb[i + 1][j - 1])count++;
				if (bomb[i + 1][j])count++;
				if (bomb[i + 1][j + 1])count++;
				
				std::cout << count;
				if (j == w - 1) {
					std::cout << "\n";
				}


			else {
				std::cout << "#";
				if (j == w - 1) {
					std::cout << "\n";
				}
			}
		}
	}
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  char c[52][52];
  cin>>h>>w;
  for(int i=1;i<=h;i++){
    for(int j=1;j<=w;j++){
      cin>>c[i][j];
    }
  }
  for(int i=1;i<=h;i++){
    for(int j=1;j<=w;j++){
      if(c[i][j]=='#') cout<<'#';
      else{
        int c=0;
        if(c[i-1][j-1]=='#') c++;
        if(c[i-1][j]=='#') c++;
        if(c[i-1][j+1]=='#') c++;
        if(c[i][j-1]=='#') c++;
        if(c[i+1][j+1]=='#') c++;
        if(c[i][j+1]=='#') c++;
        if(c[i+1][j-1]=='#') c++;
        if(c[i+1][j]=='#') c++;
        cout<<c;
      }
    }
    cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: invalid types 'int[int]' for array subscript
   17 |         if(c[i-1][j-1]=='#') c++;
      |             ^
a.cc:18:13: error: invalid types 'int[int]' for array subscript
   18 |         if(c[i-1][j]=='#') c++;
      |             ^
a.cc:19:13: error: invalid types 'int[int]' for array subscript
   19 |         if(c[i-1][j+1]=='#') c++;
      |             ^
a.cc:20:13: error: invalid types 'int[int]' for array subscript
   20 |         if(c[i][j-1]=='#') c++;
      |             ^
a.cc:21:13: error: invalid types 'int[int]' for array subscript
   21 |         if(c[i+1][j+1]=='#') c++;
      |             ^
a.cc:22:13: error: invalid types 'int[int]' for array subscript
   22 |         if(c[i][j+1]=='#') c++;
      |             ^
a.cc:23:13: error: invalid types 'int[int]' for array subscript
   23 |         if(c[i+1][j-1]=='#') c++;
      |             ^
a.cc:24:13: error: invalid types 'int[int]' for array subscript
   24 |         if(c[i+1][j]=='#') c++;
      |             ^
Language: C++

#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
using namespace std;
int n,m,mapp[105][105],num[105][105],i,j,ans=0;
char s[105];
int main()
{
    cin>>n>>m;
    for (i=1;i<=n;i++)
    {
        scanf("%s",s+1);
        for (j=1;j<=m;j++)
        {
            if(s[j]=='#')
            mapp[i][j]=1;
            else mapp[i][j]=0;
        }
    }
    for (i=1;i<=n;i++)
    {
        for (j=1;j<=m;j++)
        {
            if(mapp[i][j]==1)
            cout<<"#";
            else
            {
                ans=0;
                ans=mapp[i-1][j]+mapp[i][j-1]+mapp[i-1][j-1]+mapp[i+1][j]+mapp[i+1][j+1];
                ans=ans+mapp[i][j+1]+mapp[i+1][j-1]+mapp[i-1][j+1];
                cout<<ans;
            }
            if(j==m)
            cout<<endl;
        }
    }
    return 0;
}
                ans=0;
                ans=mapp[i-1][j]+mapp[i][j-1]+mapp[i-1][j-1]+mapp[i+1][j]+mapp[i+1][j+1];
                ans=ans+mapp[i][j+1]+mapp[i+1][j-1]+mapp[i-1][j+1];
                cout<<ans;
            }
            if(j==m)
            cout<<endl;
        }
    }
    return 0;
}

Compiler output:
a.cc:40:17: error: 'ans' does not name a type
   40 |                 ans=0;
      |                 ^~~
a.cc:41:17: error: 'ans' does not name a type
   41 |                 ans=mapp[i-1][j]+mapp[i][j-1]+mapp[i-1][j-1]+mapp[i+1][j]+mapp[i+1][j+1];
      |                 ^~~
a.cc:42:17: error: 'ans' does not name a type
   42 |                 ans=ans+mapp[i][j+1]+mapp[i+1][j-1]+mapp[i-1][j+1];
      |                 ^~~
a.cc:43:17: error: 'cout' does not name a type
   43 |                 cout<<ans;
      |                 ^~~~
a.cc:44:13: error: expected declaration before '}' token
   44 |             }
      |             ^
a.cc:45:13: error: expected unqualified-id before 'if'
   45 |             if(j==m)
      |             ^~
a.cc:47:9: error: expected declaration before '}' token
   47 |         }
      |         ^
a.cc:48:5: error: expected declaration before '}' token
   48 |     }
      |     ^
a.cc:49:5: error: expected unqualified-id before 'return'
   49 |     return 0;
      |     ^~~~~~
a.cc:50:1: error: expected declaration before '}' token
   50 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define N 10001
char s[N][N];
int main(){
	ios::sync_with_stdio(false);
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			cin>>s[i][j];
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(s[i][j]=='#')s[i][j]='#';
			if(s[i][j]=='.'){
				s[i][j]='0';
				for(int p=i-1;p<=i+1;p++){
					for(int q=j-1;q<=j+1;q++){
						if(s[p][q]=='#')s[i][j]++;
					}
				}
			}
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			cout<<char(s[i][j]);
		}
		cout<<endl;
	}
	return 0;
}}

Compiler output:
a.cc:34:2: error: expected declaration before '}' token
   34 | }}
      |  ^
Language: C

#include <stdio.h>
int main (){
int x,y,k=0,i,j;
scanf ("%d%d",&x,&y);
char a[x][y];
  for (i=0;i<x;i++){
  for (j=0;j<y;j++){
  scanf ("%c",&a[j][i]);
  }
  }
  for (i=0;i<x;i++){
  for (j=0;j<y;j++){
  if (a[j][i]=='.'){
  if (a[j-1][i-1]=='#'){k++;}
  if (a[j][i-1]=='#'){k++;}
  if (a[j+1][i-1]=='#'){k++;}
  if (a[j-1][i]=='#'){k++;}
  if (a[j+1][i]=='#'){k++;}
  if (a[j-1][i+1]=='#'){k++;}
  if (a[j][i+1]=='#'){k++;}
  if (a[j+1][i+1]=='#'){k++;}
  a[j][i]=k;
  K=0;
  }
  }
  }
  }
for (i=0;i<x;i++){
  for (j=0;j<y;j++){
  printf ("%c",&a[j][i]);
  }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:3: error: 'K' undeclared (first use in this function)
   23 |   K=0;
      |   ^
main.c:23:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:28:1: error: expected identifier or '(' before 'for'
   28 | for (i=0;i<x;i++){
      | ^~~
main.c:28:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   28 | for (i=0;i<x;i++){
      |           ^
main.c:28:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   28 | for (i=0;i<x;i++){
      |               ^~
main.c:33:3: error: expected identifier or '(' before 'return'
   33 |   return 0;
      |   ^~~~~~
main.c:34:1: error: expected identifier or '(' before '}' token
   34 | }
      | ^
Language: C++

h, w = gets.split.map(&:to_i)
board = Array.new(h) do |i|
  gets.chomp
end

dx = [0, 0, -1, -1, -1, 1,  1, 1 ]
dy = [1, -1, 0,  1, -1, 0, -1, 1 ]

h.times do |i|
  w.times do |j|
    next if board[i][j] == '#'
    cnt = 0

    8.times do |k|
      ni = i + dx[k]
      nj = j + dy[k]
      next if (ni < 0 || h <= ni)
      next if (nj < 0 || w <= nj)
      cnt += 1 if board[ni][nj] == '#'
    end
    board[i][j] = cnt.to_s
  end
end

board.each do |s|
  puts s
end

Compiler output:
a.cc:1:1: error: 'h' does not name a type
    1 | h, w = gets.split.map(&:to_i)
      | ^
Language: C++

#include<iostream>
#include<cstring>
using namespace std;
char map[101][101];
int t[101][101];
void work(int x,int y)
{
    if(map[x+1][y]=='*') t[x][y]++;
    if(map[x-1][y]=='*') t[x][y]++;
    if(map[x][y+1]=='*') t[x][y]++;
    if(map[x][y-1]=='*') t[x][y]++;
    if(map[x+1][y+1]=='*') t[x][y]++;
    if(map[x+1][y-1]=='*') t[x][y]++;
    if(map[x-1][y+1]=='*') t[x][y]++;
    if(map[x-1][y-1]=='*') t[x][y]++;
}
int main()
{
    int n,m,i,j,k=0;
    cin>>n>>m;
        ++k;
        if(n==0||m==0) break;
        for(i=1;i<=n;i++)
        for(j=1;j<=m;j++)
        cin>>map[i][j];
        for(i=1;i<=n;i++)
        for(j=1;j<=m;j++)
        {
            if(map[i][j]=='.') work(i,j);
            if(map[i][j]=='*') t[i][j]=-1;
        }
        for(i=1;i<=n;i++)
        {
            for(j=1;j<=m;j++)
            {
                if(t[i][j]==-1) cout<<"*";
                else cout<<t[i][j];
            }
            cout<<endl;
        }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: break statement not within loop or switch
   22 |         if(n==0||m==0) break;
      |                        ^~~~~
Language: C++

int main()
{   
    int h,w;
    cin>>h>>w;
    string s[h];
    for(int i=0;i<h;i++) cin>>s[i];
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            int ans=0;
            if(s[i][j]=='#') cout<<'#';
            else{
                if(i-1>=0&&j-1>=0&&s[i-1][j-1]=='#') ans++;
                if(i-1>=0&&s[i-1][j]=='#') ans++;
                if(i-1>=0&&j+1<w&&s[i-1][j+1]=='#') ans++;
                if(j-1>=0&&s[i][j-1]=='#') ans++;
                if(j+1<w&&s[i][j+1]=='#') ans++;
                if(i+1<h&&j-1>=0&&s[i+1][j-1]=='#') ans++;
                if(i+1<h&&s[i+1][j]=='#') ans++;
                if(i+1<h&&j+1<w&&s[i+1][j+1]=='#') ans++;
                cout<<ans;
            }
        }
        cout<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin>>h>>w;
      |     ^~~
a.cc:5:5: error: 'string' was not declared in this scope
    5 |     string s[h];
      |     ^~~~~~
a.cc:6:31: error: 's' was not declared in this scope
    6 |     for(int i=0;i<h;i++) cin>>s[i];
      |                               ^
a.cc:10:16: error: 's' was not declared in this scope
   10 |             if(s[i][j]=='#') cout<<'#';
      |                ^
a.cc:10:30: error: 'cout' was not declared in this scope
   10 |             if(s[i][j]=='#') cout<<'#';
      |                              ^~~~
a.cc:20:17: error: 'cout' was not declared in this scope
   20 |                 cout<<ans;
      |                 ^~~~
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout<<endl;
      |         ^~~~
a.cc:23:15: error: 'endl' was not declared in this scope
   23 |         cout<<endl;
      |               ^~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int a[8][2]={{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}}
int main(){
	string s[55];
	int h,w,i,j,k,x,y,z;
	cin >> h >> w;
	for(i=0;i<h;i++){
		cin >> s[i];
	}
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			if(s[i][j]=='.'){
				z=0;
				for(k=0;k<8;k++){
					x=i+a[k][0];
					y=j+a[k][1];
					if(x<0 || y<0 || x>=n || y>=n)
						continue;
					if(s[x][y]=='#')
						z++;
				}
				s[i][j]=z+'0';
			}
		}
	}
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			cout << s[i][j];
		}
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int main(){
      | ^~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int a[8][2]={{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}}
int main(){
	string s[55];
	int h,w,i,j,k;
	cin >> h >> w;
	for(i=0;i<h;i++){
		cin >> s[i];
	}
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			if(s[i][j]=='.'){
				w=0;
				for(k=0;k<8;k++){
					x=i+a[k][0];
					y=j+a[k][1];
					if(x<0 || y<0 || x>=n || y>=n)
						continue;
					if(s[x][y]=='#')
						w++;
				}
				s[i][j]=w+'0';
			}
		}
	}
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			cout << s[i][j];
		}
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int main(){
      | ^~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;
 
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1 
 
int main() {
    // input
    int H, W;
    cin >> H >> W;
    char vec[55][55];
	for(int i = 0;i < h; i++)
	  scanf("%s",vec[i]);
    
    
    // calculation
    int cnt;
    REP(i, H) {
        REP(j, W) {
            if (vec[i][j] == '.') {
                cnt = 0;
                for (int k = i-1; k <= i+1; ++k) {
                    for (int l = j-1; l <= j+1; ++l) {
                        if (k < 0 || l <0) {
                            continue;
                        } else if (vec[k][l] == '#') {
                            cnt++;
                        }
                    }
                }
                cout << cnt;
            }
            else {
                cout << '#';
            }
        }
        cout << "\n";
    }
    
    return 0;
}

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

#include <iostream>
#include <string>
#include <vector>
using namespace std;
 
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1 
 
int main() {
    // input
    int H, W;
    cin >> H >> W;
    char s[55][55];
	int i,j;
	for(i=0;i<h;i++)
	  scanf("%s",s[i]);
    
    
    // calculation
    int cnt;
    REP(i, H) {
        REP(j, W) {
            if (vec[i][j] == '.') {
                cnt = 0;
                for (int k = i-1; k <= i+1; ++k) {
                    for (int l = j-1; l <= j+1; ++l) {
                        if (k < 0 || l <0) {
                            continue;
                        } else if (vec[k][l] == '#') {
                            cnt++;
                        }
                    }
                }
                cout << cnt;
            }
            else {
                cout << '#';
            }
        }
        cout << "\n";
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: 'h' was not declared in this scope
   15 |         for(i=0;i<h;i++)
      |                   ^
a.cc:23:17: error: 'vec' was not declared in this scope
   23 |             if (vec[i][j] == '.') {
      |                 ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAXN=60;
bool a[MAXN][MAXN];
int h,m;
int main(){
    scanf ("%d%d",&h,&m);
    for (int i=1;i<=h;i++)
        for (int j=1;j<=m;j++){
            char x;
            scanf ("%c",&x);
            if (x=='#') a[i][j]=1;
            else a[i][j]=0;
        }
    for (int i=1;i<=h;i++){
        for (int j=1;j<=m;j++){
            if (a[i][j]){
                printf ('#');
                continue;
            }
            printf ("%d",a[i][j-1]+a[i][j+1]+a[i-1][j-1]+a[i-1][j]+a[i-1][j+1]+a[i+1][j-1]+a[i+1][j]+a[i+1][j+1]);
        }
        printf ("\n");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   18 |                 printf ('#');
      |                         ^~~
      |                         |
      |                         char
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int x[8]={-1,0,1,-1,1,-1,0,1};
  int y[8]={1,1,1,0,0,-1,-1,-1};
  int h,w;cin>>h>>w;
  string [h+2];for(int i=0;i<w+2;i++){
    s[0][i]='a';s[h+1][i]='a';
  }
  for(int i=1;i<=h;i++){
    cin>>s[i];
    s[i]="a"+s[i];s[i]=s[i]+"a";
  }
  for(int i=1;i<=h;i++){
    for(int j=1;j<=w;j++){
      if(s[i][j]=='.'){
        int cnt=0;
        for(int k=0;k<8;k++){
          if(s[i+x[k]][j+y[k]]=='#')cnt++;
        }
        s[i][j]=cnt+'a'-49;
      }
    }
  }
  for(int i=1;i<=h;i++)cout<<s[i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected ']' before '+' token
    7 |   string [h+2];for(int i=0;i<w+2;i++){
      |            ^
      |            ]
a.cc:7:10: error: structured binding declaration cannot have type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
    7 |   string [h+2];for(int i=0;i<w+2;i++){
      |          ^
a.cc:7:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:7:11: error: conflicting declaration 'auto h'
    7 |   string [h+2];for(int i=0;i<w+2;i++){
      |           ^
a.cc:6:7: note: previous declaration as 'int h'
    6 |   int h,w;cin>>h>>w;
      |       ^
a.cc:7:15: error: expected initializer before ';' token
    7 |   string [h+2];for(int i=0;i<w+2;i++){
      |               ^
a.cc:8:5: error: 's' was not declared in this scope
    8 |     s[0][i]='a';s[h+1][i]='a';
      |     ^
a.cc:11:10: error: 's' was not declared in this scope
   11 |     cin>>s[i];
      |          ^
a.cc:16:10: error: 's' was not declared in this scope
   16 |       if(s[i][j]=='.'){
      |          ^
a.cc:25:30: error: 's' was not declared in this scope
   25 |   for(int i=1;i<=h;i++)cout<<s[i]<<endl;
      |                              ^
Language: C++

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

int main() {
  int h, w;
  cin >> h >> w;
  
  string board[50];
  
  for (int i = 0; i < h; ++i) cin >> board[i];
  
  int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
  int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
  
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      if (board[i][j] == '#') continue;
      
      int num = 0;
      for (d = 0; d < 8; ++d) {
        const ni = i + dy[d];
        const nj = j + dx[d];
        
        if (ni < 0 || h <= ni) continue;
        if (nj < 0 || w <= nj) continue;
        if (board[ni][nj] =='#') num++;
      }
      
      board[i][j] = char(num + '0');
    }
  }
  
  for (int i = 0; i < h; ++i) cout << board[i] << endl;
  
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: 'd' was not declared in this scope
   21 |       for (d = 0; d < 8; ++d) {
      |            ^
a.cc:22:15: error: 'ni' does not name a type
   22 |         const ni = i + dy[d];
      |               ^~
a.cc:23:15: error: 'nj' does not name a type
   23 |         const nj = j + dx[d];
      |               ^~
a.cc:25:13: error: 'ni' was not declared in this scope; did you mean 'i'?
   25 |         if (ni < 0 || h <= ni) continue;
      |             ^~
      |             i
a.cc:26:13: error: 'nj' was not declared in this scope; did you mean 'j'?
   26 |         if (nj < 0 || w <= nj) continue;
      |             ^~
      |             j
a.cc:27:19: error: 'ni' was not declared in this scope; did you mean 'i'?
   27 |         if (board[ni][nj] =='#') num++;
      |                   ^~
      |                   i
a.cc:27:23: error: 'nj' was not declared in this scope; did you mean 'j'?
   27 |         if (board[ni][nj] =='#') num++;
      |                       ^~
      |                       j
Language: C

#include<stdio.h>

int main(){
int i,h,w,j;
scanf("%d%d",&h,&w);
char s[h][m+1];
for(i=0;i<h;i++)scanf("%d",s[i]);
for(i=0;i<h;i++){
for(j=0;j<w;j++){
if(s[i][j]=='#')putchar('#');
else {
int tmp=0;
if(i!=0&&f[i-1][j]=='#')tmp++;
if(i!=h-1&&f[i+1][j]=='#')tmp++;
if(j!=0&&f[i][j-1]=='#')tmp++;
if(j!=w-1&&f[i][j+1]=='#')tmp++;
if(i!=0&&j!=0&&f[i-1][j-1]=='#')tmp++;
if(i!=0&&j!=w-1&&f[i-1][j+1]=='#')tmp++;
if(i!=h-1&&j!=0&&f[i+1][j-1]=='#')tmp++;
if(i!=h-1&&j!=w-1&&f[i+1][j+1]=='#')tmp++;
printf("%d",tmp);
}
}
puts("");
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:11: error: 'm' undeclared (first use in this function)
    6 | char s[h][m+1];
      |           ^
main.c:6:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:10: error: 'f' undeclared (first use in this function)
   13 | if(i!=0&&f[i-1][j]=='#')tmp++;
      |          ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;

int main(){
    int h , w;
    char lei = '0', a[51][51];
    while (cin >> h >> w){


        for(int i = 0;i < h;i++)
        {
            for(int j = 0;j < w;j++)
                cin>>a[i][j];
        }
        for(i = 0;i < h;i++)
        {
            for(j = 0;j < w;j++)
            {
                lei='0';
                if(a[i][j]=='.')
                {
                    if(a[i-1][j-1]=='#')
                        lei++;
                    if(a[i][j-1]=='#')
                        lei++;
                    if(a[i+1][j-1]=='#')
                        lei++;
                    if(a[i-1][j]=='#')
                        lei++;
                    if(a[i+1][j]=='#')
                        lei++;
                    if(a[i-1][j+1]=='#')
                        lei++;
                    if(a[i][j+1]=='#')
                        lei++;
                    if(a[i+1][j+1]=='#')
                        lei++;

                    a[i][j]=lei;
                }
                else a[i][j]='#';

            }
        }
        for(i = 0;i < h;i++)
        {
            for(j = 0;j < w;j++)
                cout<<a[i][j];
            cout<<endl;
        }
    }

    return 0;
}
   选择文件


Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: 'i' was not declared in this scope
   18 |         for(i = 0;i < h;i++)
      |             ^
a.cc:20:17: error: 'j' was not declared in this scope
   20 |             for(j = 0;j < w;j++)
      |                 ^
a.cc:48:13: error: 'i' was not declared in this scope
   48 |         for(i = 0;i < h;i++)
      |             ^
a.cc:50:17: error: 'j' was not declared in this scope
   50 |             for(j = 0;j < w;j++)
      |                 ^
a.cc: At global scope:
a.cc:58:4: error: '\U00009009\U000062e9\U00006587\U00004ef6' does not name a type
   58 |    选择文件
      |    ^~~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;

int main(){
    int i , j , h , w;
    char lei = '0', a[51][51];
    while (cin >> h >> w){


        for(i = 0;i < h;i++)
        {
            for(j = 0;j < w;j++)
                cin>>a[i][j];
        }
        for(i = 0;i < h;i++)
        {
            for(j = 0;j < w;j++)
            {
                lei='0';
                if(a[i][j]=='.')
                {
                    if(a[i-1][j-1]=='#')
                        lei++;
                    if(a[i][j-1]=='#')
                        lei++;
                    if(a[i+1][j-1]=='#')
                        lei++;
                    if(a[i-1][j]=='#')
                        lei++;
                    if(a[i+1][j]=='#')
                        lei++;
                    if(a[i-1][j+1]=='#')
                        lei++;
                    if(a[i][j+1]=='#')
                        lei++;
                    if(a[i+1][j+1]=='#')
                        lei++;

                    a[i][j]=lei;
                }
                else a[i][j]='#';

            }
        }
        for(i = 0;i < h;i++)
        {
            for(j = 0;j < w;j++)
                cout<<a[i][j];
            cout<<endl;
        }
    }

    return 0;
}
   选择文件


Compiler output:
a.cc:58:4: error: '\U00009009\U000062e9\U00006587\U00004ef6' does not name a type
   58 |    选择文件
      |    ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
int main(void) {
	int h, w;
	cin >> h >> w;
	h += 2;
	w += 2;
	vector<string> s(h);
	rep(i, h-1) {
		if (i == 0)
			i++;
		cin >> s[i];
		s[i] = 'x' + s[i] + 'x';
	}
	rep(i, w) {
		s[0][i] = 'x';
		s[h - 1][i] = 'x';
	}
	rep(i, h) {
		rep(j, w) {
			if (s[i][j] == '.') {
				s[i][j] = '0';
				rep(k, 3) {
					rep(l, 3) {
                      	int hh = i - 1 + k, ww = j - i + l;
                      	if(hh < 0 || hh >= h || ww < 0 || ww >= w)continue;
						if (s[hh][ww] == '#') {
							(char)s[i][j]++;
						}
					}
				}
			}
		}
	}
	h--;
	w--;
	rep (i, h) {
		step(i, 1);
		rep(j, w) {
			step(j, 1);
			cout << s[i][j];
		}
		cout << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: 'step' was not declared in this scope; did you mean 'strsep'?
   39 |                 step(i, 1);
      |                 ^~~~
      |                 strsep
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(void) {
	int h, w;
	cin >> h >> w;
	h += 2;
	w += 2;
	vector<string> s(h);
	rep(i, h-1) {
		if (i == 0)
			i++;
		cin >> s[i];
		s[i] = 'x' + s[i] + 'x';
	}
	rep(i, w) {
		s[0][i] = 'x';
		s[h - 1][i] = 'x';
	}
	rep(i, h) {
		rep(j, w) {
			if (s[i][j] == '.') {
				s[i][j] = '0';
				rep(k, 3) {
					rep(l, 3) {
                      	int hh = i - 1 + k, ww = j - i + l;
                      	if(hh < 0 || hh >= h || ww < 0 || ww >= w)continue;
						if (s[hh][ww] == '#') {
							(char)s[i][j]++;
						}
					}
				}
			}
		}
	}
	h--;
	w--;
	rep (i, h) {
		step(i, 1);
		rep(j, w) {
			step(j, 1);
			cout << s[i][j];
		}
		cout << endl;
	}
	return 0;
}

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

#include<iotream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[50][50];
int c,d,b[55][55];
int main(){
    cin>>c>>d;
    for(int i=0;i<c;i++)
    cin>>a[i];
    for(int i=0;i<c;i++)
    for(int j=0;j<d;j++)
    if(a[i][j]=='#')
    b[i][j]++,b[i][j+1]++,b[i][j+2]++,
    b[i+1][j]++,b[i+1][j+1]++,b[i+1][j+2]++,
    b[i+2][j]++,b[i+2][j+1]++,b[i+2][j+2]++;
    for(int i=0;i<c;i++){
        for(int j=0;j<d;j++)
        if(a[i][j]=='#') cout<<'#';
        else cout<<b[i+1][j+1];
        cout<<endl;
    }

}

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

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[50][50];
int c,d,b[55][55];
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    cin>>a[i];
    for(int i=1;i<n=;i++)
    for(int j=1;j<m;j++)
    if(a[i][j]=='#')
    b[i][j]++,b[i][j+1]++,b[i][j+2]++,
    b[i+1][j]++,b[i+1][j+1]++,b[i+1][j+2]++,
    b[i+2][j]++,b[i+2][j+1]++,b[i+2][j+2]++;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++)
        if(a[i][j]=='#') cout<<'#';
        else cout<<m[i+1][j+1];
        cout<<endl;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'n' was not declared in this scope
    8 |     cin>>n>>m;
      |          ^
a.cc:8:13: error: 'm' was not declared in this scope; did you mean 'tm'?
    8 |     cin>>n>>m;
      |             ^
      |             tm
a.cc:11:21: error: expected primary-expression before ';' token
   11 |     for(int i=1;i<n=;i++)
      |                     ^
Language: C

#include<iostream>
using namespace std;
int move[8][2]={-1,-1,0,-1,1,-1-1,0,1,0,-1,1,0,1,1,1};
int main()
{
    int i,j,h,w,x;
    cin>>h>>w;
    char map[55][55];
    for(i=0;i<52;i++)
    {
        map[0][i]='.';
        map[i][0]='.';

    }
    for(i=1;1<=h;i++){
    for(j=1;j<+w;j++){

        cin>>map[i][j];
    }
}
for(i=1;i<=h;i++){
    for(j=1;j<=w;j++){
            if(map[i][j]=='.'){
                    for(x=0;x<8;x++){
                            if(map[i+move[x][0]][j+move[x][1]]=='#'){
                            }
                    }
            }
    }
    }
    for(i=1;i<=h;i++)
    {
        for(j=1;j<=w;j++){
                cout<<map[i][j];

    }
    cout<<end1;
    }
    return 0;
}


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

#include<iostream>
using namespace std;
int move[8][2]={-1,-1,0,-1,1,-1-1,0,1,0,-1,1,0,1,1,1};
int main()
{
    int i,j,h,w,x;
    cin>>h>>w;
    char map[55][55];
    for(i=0;i<52;i++)
    {
        map[0][i]='.';
        map[i][0]='.';

    }
    for(i=1;1<=h;i++){
    for(j=1;j<+w;j++){

        cin>>map[i][j];
    }
}
for(i=1;i<=h;i++){
    for(j=1;j<=w;j++){
            if(map[i][j]=='.'){
                    for(x=0;x<8;x++){
                            if(map[i+move[x][0]][j+move[x][1]]=='#'){
                            }
                    }
            }
    }
    }
    for(i=1;i<=h;i++)
    {
        for(j=1;j<=w;j++){
                cout<<map[i][j];

    }
    cout<<end1;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:38: error: reference to 'move' is ambiguous
   25 |                             if(map[i+move[x][0]][j+move[x][1]]=='#'){
      |                                      ^~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:675:5: note: candidates are: 'template<class _II, class _OI> _OI std::move(_II, _II, _OI)'
  675 |     move(_II __first, _II __last, _OI __result)
      |     ^~~~
In file included from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41:
/usr/include/c++/14/bits/move.h:137:5: note:                 'template<class _Tp> constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&)'
  137 |     move(_Tp&& __t) noexcept
      |     ^~~~
a.cc:3:5: note:                 'int move [8][2]'
    3 | int move[8][2]={-1,-1,0,-1,1,-1-1,0,1,0,-1,1,0,1,1,1};
      |     ^~~~
a.cc:25:52: error: reference to 'move' is ambiguous
   25 |                             if(map[i+move[x][0]][j+move[x][1]]=='#'){
      |                                                    ^~~~
/usr/include/c++/14/bits/stl_algobase.h:675:5: note: candidates are: 'template<class _II, class _OI> _OI std::move(_II, _II, _OI)'
  675 |     move(_II __first, _II __last, _OI __result)
      |     ^~~~
/usr/include/c++/14/bits/move.h:137:5: note:                 'template<class _Tp> constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&)'
  137 |     move(_Tp&& __t) noexcept
      |     ^~~~
a.cc:3:5: note:                 'int move [8][2]'
    3 | int move[8][2]={-1,-1,0,-1,1,-1-1,0,1,0,-1,1,0,1,1,1};
      |     ^~~~
a.cc:37:11: error: 'end1' was not declared in this scope
   37 |     cout<<end1;
      |           ^~~~
Language: C

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int cmp(int &a,int &b)
{
    return a>b;
}
int main()
{
    int n,i,j;
    while(cin>>n&&n!=0)
    {
        int a[1020];
        int b[1020];
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
        }
        for(i=0;i<n;i++)
        {
            cin>>b[i];
        }
        sort(a,a+n,cmp);
        sort(b,b+n,cmp);
        int i,j;
        i=j=0;
        int b_j,b_i;
        b_j=b_i=n-1;
        int _const=0;
        while(n--)
        {
            if(a[i]>b[j])
            {
                _const++;
                i++;
                j++;
            }
            else if(a[b_i]>b[b_j]){
                b_i--;
                b_j--;
                _const++;
            }
            else if(a[b_i]<b[j]){
                b_i--;
                j++;
                _const--;
            }
        }
        cout<<_const*200<<endl;
    }
    return 0;

}

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

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int n,len,i,j,x;
    int b;
    char a[10001];
    while(scanf("%d",&n)!=EOF)
    {
        getchar();
        while(n--)
        {
            memset(a,0,sizeof(a));
            gets(a);
            len=strlen(a);
            b=sqrt(len);
            if(b*b==len)
            {
                for(j=0; j<b; j++)
                    for(i=0; i<b; i++)
                        printf("%c",a[j+(int)b*i]);
                printf("\n");
            }
            else
                printf("INVALID\n");
        }
    }
    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:2: error: illegal character: '#'
#include<string.h>
^
Main.java:3: error: illegal character: '#'
#include<math.h>
^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
    int b;
    ^
  (use --enable-preview to enable unnamed classes)
Main.java:8: error: class, interface, enum, or record expected
    char a[10001];
    ^
Main.java:9: error: class, interface, enum, or record expected
    while(scanf("%d",&n)!=EOF)
    ^
Main.java:12: error: class, interface, enum, or record expected
        while(n--)
        ^
Main.java:15: error: class, interface, enum, or record expected
            gets(a);
            ^
Main.java:16: error: class, interface, enum, or record expected
            len=strlen(a);
            ^
Main.java:17: error: class, interface, enum, or record expected
            b=sqrt(len);
            ^
Main.java:18: error: class, interface, enum, or record expected
            if(b*b==len)
            ^
Main.java:20: error: class, interface, enum, or record expected
                for(j=0; j<b; j++)
                         ^
Main.java:20: error: class, interface, enum, or record expected
                for(j=0; j<b; j++)
                              ^
Main.java:21: error: class, interface, enum, or record expected
                    for(i=0; i<b; i++)
                             ^
Main.java:21: error: class, interface, enum, or record expected
                    for(i=0; i<b; i++)
                                  ^
Main.java:23: error: class, interface, enum, or record expected
                printf("\n");
                ^
Main.java:24: error: class, interface, enum, or record expected
            }
            ^
Main.java:27: error: class, interface, enum, or record expected
        }
        ^
Main.java:30: error: class, interface, enum, or record expected
}
^
20 errors
Language: C

#include<stdio.h>
int _move[8][2]={-1,-1,0,-1,1,1,-1,-1,0,1,0,-1,1,0,1,1,1,};
int main()
{
    int h,k,i,j,x;
    scanf("%d%d",&h,&k);
    char _map[55][55];
    for(i=0;i<52;i++)
    {
        _map[0][i]='.';
        _map[i][0]='.';
    }
    for(i=1;i<=h;i++)
    {
        for(j=1;j<=k;j++)
        {
            scanf("%d",&_map[i][j]);
        }
    }
    for(i=1;i<=h;i++)
    {
        for(j=1;j<=k;j++)
        {
            if(_map[i][j]=='.')
            {
                _map[i][j]='0';
                for(x=0;x<8;x++)
                {
                    if(_map[i+_move[x][0][j+_move[x][1]=='#'])
                    {
                        _map[i][j]++;
                    }
                }
            }
        }
    }
    for(i=1;i<=h;i++)
    {
        for(j=1;j<=k;j++)
        {
            printf("%d\n",_map[i][j]);
        }
        printf("\n");
    }
    return 0;
}

Compiler output:
main.c:2:1: warning: excess elements in array initializer
    2 | int _move[8][2]={-1,-1,0,-1,1,1,-1,-1,0,1,0,-1,1,0,1,1,1,};
      | ^~~
main.c:2:1: note: (near initialization for '_move')
main.c: In function 'main':
main.c:29:42: error: subscripted value is neither array nor pointer nor vector
   29 |                     if(_map[i+_move[x][0][j+_move[x][1]=='#'])
      |                                          ^
main.c:29:62: error: expected ']' before ')' token
   29 |                     if(_map[i+_move[x][0][j+_move[x][1]=='#'])
      |                                                              ^
      |                                                              ]
Language: C++

#include<iostream>

using namespace std;

int main()
{
  int h, w; cin >> h >> w;
  string board[50];
  for(int i = 0; i < h; ++h) cin >> board[i];

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

  for(int i = 0; i < h; ++i){
    for(int j = 0; j < w; ++j){
      if(board[i][j] == '#') continue;

      int num = 0;
      for(int d = 0; d < 8; ++d){
        const int nj = i + dx[d];
        const int ni = j + dx[d]

        if(ni < 0 or h <= ni) continue;
        if(nj < 0 or w <= nj) continue;
        if(board[ni][nj] == '#') num++;
      }

      board[i][j] = char(num + '0');
    }
  }

  for (int i = 0; i < h; ++i) cout << board[i] << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'const'
   12 |   const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}
      |   ^~~~~
a.cc:23:9: error: expected ',' or ';' before 'if'
   23 |         if(ni < 0 or h <= ni) continue;
      |         ^~
Language: C++

#include<iostream>

using namespace std;

int main()
{
  int h, w; cin >> h >> w;
  string board[50];
  for(int i = 0; i < h; ++h) cin >> board[i];

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

  for(int i = 0; i < h; ++i){
    for(int j = 0; j < w; ++j){
      if(board[i][j] == '#') continue;

      int num = 0;
      for(int d = 0; d < 8; ++d){
        const int nj = i + dx[d];

        if(ni < 0 or h <= ni) continue;
        if(nj < 0 or w <= nj) continue;
        if(board[ni][nj] == '#') num++;
      }

      board[i][j] = char(num + '0');
    }
  }

  for (int i = 0; i < h; ++i) cout << board[i] << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'const'
   12 |   const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}
      |   ^~~~~
a.cc:22:12: error: 'ni' was not declared in this scope; did you mean 'nj'?
   22 |         if(ni < 0 or h <= ni) continue;
      |            ^~
      |            nj
a.cc:24:18: error: 'ni' was not declared in this scope; did you mean 'nj'?
   24 |         if(board[ni][nj] == '#') num++;
      |                  ^~
      |                  nj
Language: C++

#include<iostream>

using namespace std;

int main()
{
  int h, w; cin >> h >> w;
  string board[50];
  for(int i = 0; i < h; ++h) cin >> board[i];

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

  for(int i = 0; i < h; ++i){
    for(int j = 0; j < w; ++j){
      if(borad[i][j] == '#') continue;

      int num = 0;
      for(int d = 0; d < 8; ++d){
        const int nj = i + dx[d];

        if(ni < 0 or h <= ni) continue;
        if(nj < 0 or w <= nj) continue;
        if(board[ni][nj] == '#') num++;
      }

      board[i][j] = char(num + '0');
    }
  }

  for (int i = 0; i < h; ++i) cout << board[i] << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'const'
   12 |   const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}
      |   ^~~~~
a.cc:16:10: error: 'borad' was not declared in this scope; did you mean 'board'?
   16 |       if(borad[i][j] == '#') continue;
      |          ^~~~~
      |          board
a.cc:22:12: error: 'ni' was not declared in this scope; did you mean 'nj'?
   22 |         if(ni < 0 or h <= ni) continue;
      |            ^~
      |            nj
a.cc:24:18: error: 'ni' was not declared in this scope; did you mean 'nj'?
   24 |         if(board[ni][nj] == '#') num++;
      |                  ^~
      |                  nj
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<iomanip>
#include<cmath>
using namespace std;
int main()
{   int n,m,i,j,s=0;
    char a[105][105];
    cin>>n>>m;
    for(i=1;i<=n;i++)
      for(j=1;j<=m;j++)cin>>a[i][j];
    for(i=1;i<=n;i++)
    {  for(j=1;j<=m;j++)
      {  if(a[i][j]=='#')cout<<a[i][j];
           else {  if(a[i-1][j-1]=='#')s++;
                   if(a[i-1][j]=='#')s++;
                   if(a[i-1][j+1]=='#')s++;
                   if(a[i][j+1]=='#')s++;
                   if(a[i+1][j+1]=='#')s++;
                   if(a[i+1][j]=='#')s++;
                   if(a[i+1][j-1]=='#')s++;
                   if(a[i][j-1]=='#')s++;
                   cout<<s;
                   s=0;
                }
      }
      cout<<en	dl;
    }
    return 0;
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:28:13: error: 'en' was not declared in this scope; did you mean 'n'?
   28 |       cout<<en  dl;
      |             ^~
      |             n
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int H,W;
  cin >> H >> W;
  char array[60][60] = {{0}};
  for(int i=0;i<H;i++) {
    cin >> array[i];
    //cout << array[i] << endl;
  }
  for(int i=0;i<H;i++) {
    for(int j=0;j<W;j++) {
      if(array[i][j] == '.') {
	int sum=0;
	for(int l=-1;l<=1;l++) {
	  for(int m=-1;m<=1;m++) {
	    if((l==0 $$ m==0) || i+l<0 || j+m<0) continue;
	    else if(array[i+l][j+m] == '#') sum++;
	  }
	}
	//cout << sum << endl;
	array[i][j] = sum + '0';
      }
    }
    cout << array[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: expected ')' before '$$'
   18 |             if((l==0 $$ m==0) || i+l<0 || j+m<0) continue;
      |                ~    ^~~
      |                     )
a.cc:18:58: error: expected ')' before ';' token
   18 |             if((l==0 $$ m==0) || i+l<0 || j+m<0) continue;
      |               ~                                          ^
      |                                                          )
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int n,m,a[60][60];
char c;

int main()
{ 
    int le=-10;
    cin>>n>>m;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
        {
            cin>>c;
            if(c=='#')
            {
                a[i][j]=le;
                a[i-1][j-1]++;
                a[i-1][j]++;
                a[i-1][j+1]++;
                a[i][j-1]++;
                a[i][j+1]++;
                a[i+1][j-1]++;
                a[i+1][j]++;
                a[i+1][j+1]++;
            }
        }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
            if(a[i][j]<0)cout<<"#";
            else cout<<a[i][j];
        cout<<endl；
    }   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:15: error: 'endl\U0000ff1b' was not declared in this scope
   34 |         cout<<endl；
      |               ^~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
int a,b;
int tot=0;
char s[101[101];
int main()
{
    cin>>a>>b;
    for(int i=1;i<=a;i++)
    for(int j=1;j<=b;j++)
    {
        cin>>s[i][j];
        if(s[i][j]=='.')
        {
          if(s[i][j+1]=='#')
          tot++;
          if(s[i+1][j]=='#')
          tot++;
          if(s[i-1][j]=='#')
          tot++;
          if(s[i][j-1]=='#')
          tot++;
          s[i][j]=tot;
        }
        cout<<s[i][j];
    }
    return 0;
}

Compiler output:
a.cc:10:11: error: invalid types 'int[int]' for array subscript
   10 | char s[101[101];
      |           ^
a.cc:10:16: error: expected ']' before ';' token
   10 | char s[101[101];
      |                ^
      |                ]
a.cc: In function 'int main()':
a.cc:17:14: error: 's' was not declared in this scope
   17 |         cin>>s[i][j];
      |              ^
Language: C++

#include<iostream>
using namespace std;
int main() {
	int H, W;
	cin >> H >> W;

	string board[H];
	for (int i = 0; i < H; i++)
		cin >> board[i];

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

	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (board[i][j] == '#')
				continue;
			int sum = 0;
			for (int d = 0; d < 8; d++) {
				int ni = i + dx[d], nj = j + dy[d];
				if (ni < 0 or h <= ni)
					continue;
				if (nj < 0 or w <= nj)
					continue;
				if (board[ni][nj] == '#')
					sum++;
			}
			board[i][j] = char(sum + '0');
		}
	}

	for (int i = 0; i < H; i++)
		cout << board[i] << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:47: error: 'h' was not declared in this scope
   21 |                                 if (ni < 0 or h <= ni)
      |                                               ^
a.cc:23:47: error: 'w' was not declared in this scope
   23 |                                 if (nj < 0 or w <= nj)
      |                                               ^
Language: C++

#include <iostream>
#include <vector>
#include "../cxx-prettyprint/prettyprint.hpp"

int main() {
    int H, W;
    std::cin >> H >> W;

    std::vector<std::vector<char>> S;
    S.assign(H + 2, std::vector<char>(W + 2, '_'));
    for (int i = 1; i <= H; i ++) {
        for (int j = 1; j <= W; j ++) {
            std::cin >> S[i][j];
        }
    }

    for (int i = 1; i <= H; i ++) {
        for (int j = 1; j <= W; j ++) {
            if (S[i][j] == '.') {
                int count =
                        (S[i - 1][j - 1] == '#') + (S[i - 1][j] == '#') + (S[i - 1][j + 1] == '#') +
                        (S[i][j - 1] == '#') + (S[i][j + 1] == '#') +
                        (S[i + 1][j - 1] == '#') + (S[i + 1][j] == '#') + (S[i + 1][j + 1] == '#');
                std::cout << count;
            } else {
                std::cout << S[i][j];
            }
        }
        std::cout << std::endl;
    }
}


Compiler output:
a.cc:3:10: fatal error: ../cxx-prettyprint/prettyprint.hpp: No such file or directory
    3 | #include "../cxx-prettyprint/prettyprint.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.