criyle/codenet-compile-errors huggingface dataset:
Language: Java

#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 h,w;
    cin>>h>>w;
    char _map[55][55];
    for(int i = 0; i<52; i++)
    {
        _map[0][i]='.';
        _map[i][0]='.';
    }
    for(int i = 1; i<=h; i++)
    {
        for(int j = 1; j<=w; j++)
        {
            cin>>_map[i][j];
        }
    }
    for(int i = 1; i<=h; i++)
    {
        for(int j = 1; j<=w; j++)
        {
            if(_map[i][j]=='.')
            {
                _map[i][j]='0';
                for(int x=0; x<8; x++)
                {
                    if(_map[i+_move[x][0]][j+_move[x][1]]=='#')
                    {
                        _map[i][j]++;
                    }
                }
            }
        }
    }
    for(int i = 1; i<=h; i++)
    {
        for(int j = 1; j<=w; j++)
        {
            cout<<_map[i][j];
        }
        cout<<endl;
    }
    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include <iostream>
         ^
Main.java:3: error: class, interface, enum, or record expected
int _move[8][2] = {-1,-1,0,-1,1,-1,-1,0,1,0,-1,1,0,1,1,1,};
^
Main.java:7: error: not a statement
    cin>>h>>w;
          ^
Main.java:18: error: not a statement
            cin>>_map[i][j];
               ^
Main.java:42: error: not a statement
            cout<<_map[i][j];
                ^
Main.java:44: error: not a statement
        cout<<endl;
            ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main( )
^
  (use --enable-preview to enable unnamed classes)
Main.java:8: error: ']' expected
    char _map[55][55];
              ^
9 errors
Language: C++

#include <bits/stdc++.h>

#define mod 1000000007

using namespace std;
 
int main(void){
	
	int H, W, bomb;
	
	cin >> H >> W;
	
	char S[H][W];
	
	for(int i=0; i<H; i++){
		for(int j=0, j<W; j++)
			cin >> S[j][i];
	}	
	
	for(int i=0; i<W; i++){
		bomb = 0;
		for(int j=0; j<H; j++){
			if(S[i][j] == '.'){
				if(S[i-1][j-1] == '#')
					bomb++;
				if(S[i-1][j] == '#')
					bomb++;
				if(S[i-1][j+1] == '#')
					bomb++;
				if(S[i][j-1] == '#')
					bomb++;
				if(S[i][j+1] == '#')
					bomb++;
				if(S[i+1][j-1] == '#')
					bomb++;
				if(S[i+1][j] == '#')
					bomb++;
				if(S[i+1][j+1] == '#')
					bomb++;
				cout << bomb;
			}else
				cout << '#';
		}
		cout << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: expected ';' before '<' token
   16 |                 for(int j=0, j<W; j++)
      |                               ^
      |                               ;
a.cc:16:31: error: expected primary-expression before '<' token
Language: C

#include <stdio.h>
int main(){
  int h,w;
  int sx[8]={-1,0,1,-1,1,-1,0,1}
  int sy[8]={-1,-1,-1,0,0,1,1,1};
  char s[50][51];
  scanf("%d%d",&h,&w);
  for(int i=0;i<h;i++)scanf("%s",s);
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      int c=0;
      if(s[i][j]=='.')for(int k=0;k<8;k++)if(s[sy[k]][sx[k]]=='#')c++;
      s[i][j]=='0'+c;
    }
  }
  for(int i=0;i<h;i++)printf("%s",s[i]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:3: error: expected ',' or ';' before 'int'
    5 |   int sy[8]={-1,-1,-1,0,0,1,1,1};
      |   ^~~
main.c:12:48: error: 'sy' undeclared (first use in this function); did you mean 's'?
   12 |       if(s[i][j]=='.')for(int k=0;k<8;k++)if(s[sy[k]][sx[k]]=='#')c++;
      |                                                ^~
      |                                                s
main.c:12:48: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

H, W = [int(i) for i in input().split()]
S = ['.' * (W + 2)]
for i in range(H):
  S.append('.' + input() + '.')
S.append('.' * (W + 2))

mine = [[0 for _ in range(W)] for _ in range(H)]
for j in range(H):
  for i in range(W):
    if S[j + 1][i + 1] == '#':
      mine[j][i] = '#'
    else:
      mine[j][i] = sum([s[i:i + 3].count('#') for s in S[j:j + 3]])
      
for m in mine:
  print(''.join([str(i) for i in m]))


Compiler output:
a.cc:16:9: error: empty character constant
   16 |   print(''.join([str(i) for i in m]))
      |         ^~
a.cc:1:1: error: 'H' does not name a type
    1 | H, W = [int(i) for i in input().split()]
      | ^
Language: C++

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

int main(){
  int h,w; cin>>h >>w;
  char s[h][w];
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>s[i][j];
    }
  }
  
  int dx[8]={-1,-1,-1,0,0,1,1,1};
  int dy[8]={-1,0,1,-1,1,-1,0,1};
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      int cnt=0;
      if(s[i][j]=='.'){
        for(int k=0;k<8;k++){
        	if(c[i+dy[k]][j+dx[k]]=='#')cnt++;
      	}
        s[i][j]=cnt;
      }
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cout<<s[i][j];
    }
    cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: 'c' was not declared in this scope
   20 |                 if(c[i+dy[k]][j+dx[k]]=='#')cnt++;
      |                    ^
Language: C++

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

int main(){
  int h,w; cin>>h >>w;
  char s[h][w];
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>s[i][j];
    }
  }
  
  int dx={-1,-1,-1,0,0,1,1,1};
  int dy={-1,0,1,-1,1,-1,0,1};
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      int cnt=0;
      if(s[i][j]=='.'){
        for(int k=0;k<8;k++){
        	if(c[i+dy[k]][j+dx[k]]=='#')cnt++;
      	}
        s[i][j]=cnt;
      }
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cout<<s[i][j];
    }
    cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: scalar object 'dx' requires one element in initializer
   13 |   int dx={-1,-1,-1,0,0,1,1,1};
      |       ^~
a.cc:14:7: error: scalar object 'dy' requires one element in initializer
   14 |   int dy={-1,0,1,-1,1,-1,0,1};
      |       ^~
a.cc:20:20: error: 'c' was not declared in this scope
   20 |                 if(c[i+dy[k]][j+dx[k]]=='#')cnt++;
      |                    ^
Language: C++

#include <iostream>

using namespace std;

int main(void)
{
int h,w;
cin >> h >> w;

string board[50];

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

const int dx[8]={1,0,-1,0,1,-1,-1,1};//現在位置の周囲8マスを探索(縦dx,横dy)
const int dy[8]={0,1,0,-1,1,1,-1,-1};

for(i=0;i<h;i++){
  for(int j=0;j<w;j++){
    if(board[i][j]=='#') contniue;
	
    int num=0;
    for(int k=0;k<8;k++){
        const int ni=i+dx[k];
        const int nj=j+dy[k];
      
      if(ni<0 or ni=<h)continue;
      if(nj<0 or nj=<j)continue;
      if(board[ni][nj]=='#')num++;
    }
    board[i][j]=char(num+'0');    
        
 }
}
for(i=0;i<h;i++)cout<<board[h]<<endl;

return0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'i' was not declared in this scope
   18 | for(i=0;i<h;i++){
      |     ^
a.cc:20:26: error: 'contniue' was not declared in this scope
   20 |     if(board[i][j]=='#') contniue;
      |                          ^~~~~~~~
a.cc:27:21: error: expected primary-expression before '<' token
   27 |       if(ni<0 or ni=<h)continue;
      |                     ^
a.cc:28:21: error: expected primary-expression before '<' token
   28 |       if(nj<0 or nj=<j)continue;
      |                     ^
a.cc:35:5: error: 'i' was not declared in this scope
   35 | for(i=0;i<h;i++)cout<<board[h]<<endl;
      |     ^
a.cc:37:1: error: 'return0' was not declared in this scope
   37 | return0;
      | ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  //入力
  int h, w;
  cin >> h >> w;
  //一つの文字列に
  string s;
  for(int i = 0; i < h; i++) {
    string f;
    cin >> f;
    s += f;
  }
  //＃を数える s.at(i*w+j)が基本
  for(int i = 0; i < h; i++) {
    for(int j = 0; j < w; j++) {
      int count = 0;
      if(i!=0 && j!=0 && s.at((i-1)*w+j-1)=='#') count++;
      if(i!=0 && s.at((i-1)*w+j)=='#') count++;
      if(i!=0 && j!=w-1 && s.at((i-1)*w+j+1)=='#') count++;
      if(j!=0 && s.at(i*w+j-1)=='#') count++;
      if(j!=w-1 && s.at(i*w+j+1)=='#') count++;
      if(i!=h-1 && j!=0 && s.at((i+1)*w+j-1)=='#') count++;
      if(i!=h-1 && s.at((i+1)*w+j)=='#') count++;
      if(i!=h-1 && j!=w-1 && s.at((i+1)*w+j+1)=='#') count++;
      //入れ替え
      if(s.at(i*w+j) == '#') continue;
      else if(count == 1) s.at(i*w+j) = '1';
      else if(count == 2) s.at(i*w+j) = '2';
      else if(count == 3) s.at(i*w+j) = '3';
      else if(count == 4) s.at(i*w+j) = '4';
      else if(count == 5) s.at(i*w+j) = '5';
      else if(count == 6) s.at(i*w+j) = '6';
      else if(count == 7) s.at(i*w+j) = '7';
      else if(count == 8) s.at(i*w+j) = '8';
      else if(count == 0) s.at(i*w+j) = '0';
    }
  }
  //改行して出力
  for(int i = 0; i < h; i++) {
    for(int j = 0; j < w; j++) {
      cout << s.at(i*W+j);
      if(j == w - 1) cout << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:22: error: 'W' was not declared in this scope
   42 |       cout << s.at(i*W+j);
      |                      ^
Language: C++

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

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

int main(){
  int X, Y;
  cin >> X >> Y;
  for (int i = 0; i < X; i++) cin >> board[i];
  
  for (int i = 0; i < X; i++) {
    for (int j = 0; j < X; j++) {
      if (board[i][j] == '.') {
        int cnt = 0;
        for (int k = 0; k < 8; k++) {
          int x = i + dx[k];
          int y = i + dy[k];
          if (x >= 0 && x < X && y >= 0 && y < Y && board[x][y] == '#') 
            cnt++;
        }
        board[i][j] = '0' + cnt;
      }
    }
  }
  for (int i = 0; i < X; i++) cout << board[i] << endl;
  return 0;
  
}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int dy[] = {0, 1, 1, 1, 0, -1, -1, -1}
      | ^~~
a.cc: In function 'int main()':
a.cc:19:23: error: 'dy' was not declared in this scope; did you mean 'y'?
   19 |           int y = i + dy[k];
      |                       ^~
      |                       y
Language: C++

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

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

int main(){
  int X, Y;
  cin >> X >> Y;
  for (int i = 0; i < X; i++) cin >> board[i];
  
  for (int i = 0; i < X; i++) {
    for (int j = 0; j < X; j++) {
      if (board[i][j] == '.') {
        int cnt = 0;
        for (int k = 0; k < 8; k++) {
          int x = i + dx[k];
          int y = i + dy[k];
          if (x >= 0 && x < X && y >= 0 && y < Y && board[x][y] == '#') 
            cnt++;
        }
        board[i][j] = '0' + cnt;
      }
    }
  }
  for (int i = 0; i < X; i++) cout << boatd[i] << endl;
  return 0;
  
}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int dy[] = {0, 1, 1, 1, 0, -1, -1, -1}
      | ^~~
a.cc: In function 'int main()':
a.cc:19:23: error: 'dy' was not declared in this scope; did you mean 'y'?
   19 |           int y = i + dy[k];
      |                       ^~
      |                       y
a.cc:27:39: error: 'boatd' was not declared in this scope; did you mean 'board'?
   27 |   for (int i = 0; i < X; i++) cout << boatd[i] << endl;
      |                                       ^~~~~
      |                                       board
Language: C++

#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <sstream>
using namespace std;
 
int main(){
 int h;	//行数を格納する変数
 int w;	//列を格納する変数
  
 int count=0; //爆弾の個数を格納する変数
  
 int i,j; //for文で使う変数
 vector<string> s(50);	//マス目を格納する変数
  
 cin>>h>>w;	//行と列を入力する
  
 for(i=0;i<h;i++){
	cin>>s.at(i);	//マス目を入力する
	}
  for(i=0;i<h;i++){
  	for(j=0;j<w;j++){
      if(s.at(i).at(j)=='.'){// i行目のj文字目が爆弾マスでない時

        if(i-1>=0){
    	    if(s.at(i-1).at(j)=='#'){//上に爆弾マスがあるとき
                count++;
            }
        }

        if(i+1<h){
            if(s.at(i+1).at(j)=='#'){//下に爆弾マスがあるとき
        	    count++;
            }
        }

        if(j-1>=0){
            if(s.at(i).at(j-1)=='#'){//左に爆弾マスがあるとき
        	    count++;
            }   
        }

        if(j+1<w){
            if(s.at(i).at(j+1)=='#'){//右に爆弾マスがあるとき
        	    count++;
            }
        }

        if(i-1>=0 && j-1>=0){
            if(s.at(i-1).at(j-1)=='#'){//左上に爆弾マスがあるとき
        	    count++;
            }
        }

        if(i-1>=0 && j+1<w){
            if(s.at(i-1).at(j+1)=='#'){//右上に爆弾マスがあるとき
        	    count++;
            }
        }

        if(i+1<h && j-1>=0){
            if(s.at(i+1).at(j-1)=='#'){//左下に爆弾マスがあるとき
        	    count++;
            }
        }
        if(i+1<h && j+1<w){
            if(s.at(i+1).at(j+1)=='#'){//右下に爆弾マスがあるとき
        	    count++;
            }
        }
        
       //爆弾の個数を代入
        string str = to_string( count );
       	s.at(i).at(j)=str;
        count=0;
      }
    }
  }
  
  for(i=0;i<h;i++){
	cout<<s.at(i)<<endl;	//マス目を出力する
	}
}




Compiler output:
a.cc: In function 'int main()':
a.cc:74:23: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
   74 |         s.at(i).at(j)=str;
      |                       ^~~
      |                       |
      |                       std::string {aka std::__cxx11::basic_string<char>}
Language: C++

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

int main(){
 int H;	//行数を格納する変数
 int W;	//列を格納する変数
  
 int count; //爆弾の個数を格納する変数
  
 int i,j; //for文で使う変数
 vector<string> h(50);	//マス目を格納する変数
  
 cin>>a>>b;	//行と列を入力する
  
 for(i=0;i<a;i++){
	cin>>h.at(i);	//マス目を入力する
	}
  
  for(i=0;i<a;i++){
  	for(j=0;j<a;j++){
      if(h.at(i).at(j)=='.'){// 爆弾マスでない時
        
    	if(h.at(i-1).at(j)=='#'){//一つ上に爆弾マスがあるとき
        	d++
        }
        if(
      }
    }
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'a' was not declared in this scope
   13 |  cin>>a>>b;     //行と列を入力する
      |       ^
a.cc:13:10: error: 'b' was not declared in this scope
   13 |  cin>>a>>b;     //行と列を入力する
      |          ^
a.cc:24:17: error: 'd' was not declared in this scope
   24 |                 d++
      |                 ^
a.cc:27:7: error: expected primary-expression before '}' token
   27 |       }
      |       ^
a.cc:26:12: error: expected ')' before '}' token
   26 |         if(
      |           ~^
      |            )
   27 |       }
      |       ~     
a.cc:27:7: error: expected primary-expression before '}' token
   27 |       }
      |       ^
Language: C++

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

int main(void){
 
  int H,W;
  
  cin >> H >> W;
  
  //周囲8マスをしらべるための配列を作成
  int dh[] = { -1, -1,  0, -1,  1, 1, 0, 1};
  int dw[] = { -1,  0, -1,  1, -1, 0, 1, 1};
  
  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){
      if(S[i][j] == '.'){
        int count = 0;
        for(int k = 0; k < 8; ++k){
          int h = i + dh[k];
          int w = j + dw[k];
          //存在しないマスを見ていないか確認した後、'#'の判定をする
          if(h >= 0 && h < H && w >= 0 && w < W && S[h][k] == '#') count++;
        }   
        //intの数値をcharに変換
        S[i][j] = '0' + count;
    }
  }
  
  for(int i = 0; i < H; i++) cout << S[i] << endl;
  
  return 0;
}

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

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

/* #pragma */
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int GCD(int a,int b){return b?GCD(b,a%b):a;}
long long GCD(long long a, long long b){return b ? GCD(b, a%b) : a;}
int LCM(int a, int b){return a * b / GCD(a, b);}
long long LCM(long long a, long long b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right

//#define int ll
//#define int long long

//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//chcp 65001

signed main()
{
	int h, w; cin >> h >> w;
	string s[100];
	for(int i = 0, i_len = h; i < i_len; ++i){
		cin >> s[i];
	}

	for(int i = 0, i_len = h; i < i_len; ++i){
		for(int j = 0, i_len = w; i < i_len; ++i){
			if(s[i][j] == '#')cout << "#" << endl;
			else{
				int cnt = 0;
				for (int k = 0; k < 8; ++k)
				{
					int cx = i + dx[k], cy = j + dy[k];
					if(cx < 0 || cx >= h || cy < 0 || cy >= w)continue;
					if(s.[cx][cy] == '#')++cnt;
				}
				cout << cnt << endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:46: error: expected unqualified-id before '[' token
   71 |                                         if(s.[cx][cy] == '#')++cnt;
      |                                              ^
Language: C++

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

/* #pragma */
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int GCD(int a,int b){return b?GCD(b,a%b):a;}
long long GCD(long long a, long long b){return b ? GCD(b, a%b) : a;}
int LCM(int a, int b){return a * b / GCD(a, b);}
long long LCM(long long a, long long b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right

//#define int ll
//#define int long long

//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//chcp 65001

signed main()
{
	int h, w; cin >> h >> w;
	string s[100];
	for(int i = 0, i_len = h; i < i_len; ++i){
		cin >> s[i];
	}

	for(int i = 0, i_len = h; i < i_len; ++i){
		for(int j = 0, i_len = w; i < i_len; ++i){
			if(s.at(i).at(j) == '#')cout << "#" << endl;
			else{
				int cnt = 0;
				for (int k = 0; k < 8; ++k)
				{
					int cx = i + dx[k], cy = j + dy[k];
					if(cx < 0 || cx >= h || cy < 0 || cy >= w)continue;
					if(s.at(cx).at(cy) == '#')++cnt;
				}
				cout << cnt << endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:30: error: request for member 'at' in 's', which is of non-class type 'std::string [100]' {aka 'std::__cxx11::basic_string<char> [100]'}
   64 |                         if(s.at(i).at(j) == '#')cout << "#" << endl;
      |                              ^~
a.cc:71:46: error: request for member 'at' in 's', which is of non-class type 'std::string [100]' {aka 'std::__cxx11::basic_string<char> [100]'}
   71 |                                         if(s.at(cx).at(cy) == '#')++cnt;
      |                                              ^~
Language: C++

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

/* #pragma */
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int GCD(int a,int b){return b?GCD(b,a%b):a;}
long long GCD(long long a, long long b){return b ? GCD(b, a%b) : a;}
int LCM(int a, int b){return a * b / GCD(a, b);}
long long LCM(long long a, long long b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right

//#define int ll
//#define int long long

//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//chcp 65001

signed main()
{
	int h, w; cin >> h >> w;
	vector<string> vs;
	for(int i = 0, i_len = h; i < i_len; ++i){
		cin >> vs[i];
	}

	for(int i = 0, i_len = h; i < i_len; ++i){
		for(int i = 0, i_len = w; i < i_len; ++i){
			if(vs.at(i).at(j) == '#')cout << "#" << endl;
			else{
				int cnt = 0;
				for (int k = 0; k < 8; ++k)
				{
					int cx = i + dx[k], cy = j + dy[k];
					if(cx < 0 || cx >= h || cy < 0 || cy >= w)continue;
					if(vs.at(cx).at(cy) == '#')++cnt;
				}
				cout << cnt << endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:40: error: 'j' was not declared in this scope
   64 |                         if(vs.at(i).at(j) == '#')cout << "#" << endl;
      |                                        ^
Language: C++

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

/* #pragma */
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int GCD(int a,int b){return b?GCD(b,a%b):a;}
long long GCD(long long a, long long b){return b ? GCD(b, a%b) : a;}
int LCM(int a, int b){return a * b / GCD(a, b);}
long long LCM(long long a, long long b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right

//#define int ll
//#define int long long

//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//chcp 65001

signed main()
{
	int h, w; cin >> h >> w;
	vector<string> vs;
	for(int i = 0, i_len = h; i < i_len; ++i){
		cin >> vs[i];
	}

	for(int i = 0, i_len = h; i < i_len; ++i){
		for(int i = 0, i_len = w; i < i_len; ++i){
			if(s.at(i).at(j) == '#')cout << "#" << endl;
			else{
				int cnt = 0;
				for (int k = 0; k < 8; ++k)
				{
					int cx = i + dx[k], cy = j + dy[k];
					if(cx < 0 || cx >= h || cy < 0 || cy >= w)continue;
					if(vs.at(cx).at(cy) == '#')++cnt;
				}
				cout << cnt << endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:28: error: 's' was not declared in this scope
   64 |                         if(s.at(i).at(j) == '#')cout << "#" << endl;
      |                            ^
a.cc:64:39: error: 'j' was not declared in this scope
   64 |                         if(s.at(i).at(j) == '#')cout << "#" << endl;
      |                                       ^
Language: C++

#include "pch.h"
#include <iostream>
#include <string>

using namespace std;

int w = -1;
int h = -1;

void checkMines(string mineField[50]);
int main()
{
    string input[50];
    cin >> h;
    cin >> w;
    for (int i = 0; i < h; i++)
    {
      cin >> input[i];
    }

    checkMines(input);
	return 0;
}

void checkMines(string mineField[50]) {
	string answer[50];
	for (int i = 0; i < h; i++)
	{
		answer[i] = mineField[i];
	}

	for (int currRow = 0; currRow < h; currRow++)
	{
		for (int currCol = 0; currCol < w; currCol++)
		{
			int mineCount = 0;

			//cout << "\nChecking " << currRow << ", " << currCol << endl;

			if (mineField[currRow][currCol] != '#')
			{
				int checkRow = currRow - 1;
				int checkCol = currCol - 1;

				for (int i = 0; i < 3; i++)
				{
					for (int j = 0; j < 3; j++) 
					{
						
						if (checkCol > -1 && checkCol < w && checkRow > -1 && checkRow < h) 
						{
							//cout << "\nMine search for " << checkRow << ", " << checkCol << endl;
							if (mineField[checkRow][checkCol] == '#')
							{
								mineCount++;
								//cout << "Found mine at: " << checkRow <<  ", " << checkCol << endl;
							}
						}
						checkCol++;
					}
					//cout << "\nNEXT ROW\n";
					checkCol = currCol - 1;
					checkRow++;
				}
				char digit = mineCount + 48;
				//cout << "\nAdding Answer to " << currRow << ", " << currCol << " with value of: " << digit << endl;
				answer[currRow][currCol] = digit;
			}
			else {
				//cout << "\nAdding Answer to " << currRow << ", " << currCol << " with value of: " << "#" << endl;
				answer[currRow][currCol] = '#';
			}
			
		}
	}
	cout << "\n----ANSWER----\n\n";
	for (int i = 0; i < h; i++)
	{
		cout << answer[i] << "\n";
	}
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  cin>>h>>w;
  vector<vector<char>> s(h,vector<char>>(w));
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>s.at(i).at(j);
    }
  }
  int dx={1,1,1,0,0,-1,-1,-1},dy={1,0,-1,1,-1,1,0,-1};
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      int count=0;
      if(s.at(i).at(j)=='.'){
        for(int k=0;k<8;k++){
          if(i+dx[k]>=0&&i+dx[k]<h&&j+dy[k]&&j+dy[k]<w&&s.at(i+dx[k]).at(j+dy[k])=='#'){
            count++;
          }
        }
      }
      s.at(i).at(j)==count;
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cout<<s.at(i).at(j);
    }
    cout<<endl;
  }
}
            

Compiler output:
a.cc: In function 'int main()':
a.cc:6:39: error: expected primary-expression before '>' token
    6 |   vector<vector<char>> s(h,vector<char>>(w));
      |                                       ^~
a.cc:12:7: error: scalar object 'dx' requires one element in initializer
   12 |   int dx={1,1,1,0,0,-1,-1,-1},dy={1,0,-1,1,-1,1,0,-1};
      |       ^~
a.cc:12:31: error: scalar object 'dy' requires one element in initializer
   12 |   int dx={1,1,1,0,0,-1,-1,-1},dy={1,0,-1,1,-1,1,0,-1};
      |                               ^~
Language: C++

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

int main() {
  int h, w;
  cin >> h >> w;
  string brd[50];
  for(int i = 0; i < h; i++) {
    cin >> brd[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(brd[i][j] == '#') continue;
      int num = 0;
      for(int d = 0; d < 8; d++) {
        int ni = i + dy[d];
        int nj = j + dx[d];

        if(ni < 0 || h <= hi) continue;
        if(nj < 0 || w <= nj) continue;
        if(brd[ni][nj] == '#') num++;
      }
      brd[i][j] = char(num + '0');
      for(int i = 0; i < h; i++) {
        cout << brd[i] << endl;
      }
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: 'hi' was not declared in this scope; did you mean 'ni'?
   22 |         if(ni < 0 || h <= hi) continue;
      |                           ^~
      |                           ni
Language: C++

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

int main(){
  int H, W;
  cin >> H >> W;
  string S[50];
  for(int i = 0; i < H; i++){
    cin >> S[i];
  }//Sの配置完了
  int idx[] = {1,1,0,-1,-1,-1,0,1};
 int idy[] = {0,1,1,1,0,-1,-1,-1};
 for(int i = 0; i  < H ; i++){//1
  for(int j = 0; j  < W ; j++){//2
     if(S[i][j] == '.'){//3
                            int cnt = 0;
     for(int k = 0; k  < 8 ; k++){//4
                                   int x = i + idx[k];
                                   int y = j + idy[k];
      
      if(x >= 0 && x < H && y >= 0 && y <  W && S[x][y] == '#')
         {cnt++;}
         }//4
      board[i][j] = '0' + cnt;}}}//3//2//1
   for(int i = 0; i < H; i++)
   {cout << board[i] <<endl;}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: 'board' was not declared in this scope
   24 |       board[i][j] = '0' + cnt;}}}//3//2//1
      |       ^~~~~
a.cc:26:13: error: 'board' was not declared in this scope
   26 |    {cout << board[i] <<endl;}
      |             ^~~~~
Language: C++

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

int main(){
  int H, W;
  cin >> H >> W;
  string S[50];
  int x=0;
  for(int i = 0; i < H; i++){
    cin >> S[i];
  }//Sの配置完了
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if(S[i][j] == '.'){
        if((0<i-1<H-1)&&(0<j-1<W-1)){
          if(S[i-1][j-1]=='#'){
          x++;
          }
        }
        if((0<i-1<H-1)&&(0<j<W-1)){
          if(S[i-1][j]=='#'){
          x++;
          }
        }
        if((0<i-1<H-1)&&(0<j+1<W-1)){
          if(S[i-1][j+1]=='#'){
          x++;
          }
        }
        if((0<i<H-1)&&(0<j-1<W-1)){
          if(S[i][j-1]=='#'){
          x++;
          }
        }
        if((0<i<H-1)&&(0<j+1<W-1)){
          if(S[i][j+1]=='#'){
          x++;
          }
        }
        if((0<i+1<H-1)&&(0<j-1<W-1)){
          if(S[i+1][j-1]=='#'){
          x++;
          }
        }
          if((0<i+1<H-1)&&(0<j<W-1)){
            if(S[i+1][j]=='#'){
          x++;
            }
        }
          if((0<i+1<H-1)&&(0<j+1<W-1)){
            if(S[i+1][j+1]=='#'){
          x++;
            }
        }
        S[i][j]='x';
      }
    }
  }
  cout << S << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:59:21: error: expected '}' at end of input
   59 |   cout << S << endl;
      |                     ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
  int H, W;
  cin >> H >> W;
  string S[50];
  int x=0;
  for(int i = 0; i < H; i++){
    cin >> S[i];
  }//Sの配置完了
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if(S[i][j] == '.'){
        if((0<i-1<H-1)&&(0<j-1<w-1)){
          if(S[i-1][j-1]=='#'){
          x++;
          }
        }
        if((0<i-1<H-1)&&(0<j<w-1)){
          if(S[i-1][j]=='#'){
          x++;
          }
        }
        if((0<i-1<H-1)&&(0<j+1<w-1)){
          if(S[i-1][j+1]=='#'){
          x++;
          }
        }
        if((0<i<H-1)&&(0<j-1<w-1)){
          if(S[i][j-1]=='#'){
          x++;
          }
        }
        if((0<i<H-1)&&(0<j+1<w-1)){
          if(S[i][j+1]=='#'){
          x++;
          }
        }
        if((0<i+1<H-1)&&(0<j-1<w-1)){
          if(S[i+1][j-1]=='#'){
          x++;
          }
        }
          if((0<i+1<H-1)&&(0<j<w-1)){
            if(S[i+1][j]=='#'){
          x++;
            }
        }
          if((0<i+1<H-1)&&(0<j+1<w-1)){
            if(S[i+1][j+1]=='#'){
          x++;
            }
        }
        S[i][j]='x';
      }
    }
  }
  cout << S << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: error: 'w' was not declared in this scope
   15 |         if((0<i-1<H-1)&&(0<j-1<w-1)){
      |                                ^
a.cc:20:30: error: 'w' was not declared in this scope
   20 |         if((0<i-1<H-1)&&(0<j<w-1)){
      |                              ^
a.cc:25:32: error: 'w' was not declared in this scope
   25 |         if((0<i-1<H-1)&&(0<j+1<w-1)){
      |                                ^
a.cc:30:30: error: 'w' was not declared in this scope
   30 |         if((0<i<H-1)&&(0<j-1<w-1)){
      |                              ^
a.cc:35:30: error: 'w' was not declared in this scope
   35 |         if((0<i<H-1)&&(0<j+1<w-1)){
      |                              ^
a.cc:40:32: error: 'w' was not declared in this scope
   40 |         if((0<i+1<H-1)&&(0<j-1<w-1)){
      |                                ^
a.cc:45:32: error: 'w' was not declared in this scope
   45 |           if((0<i+1<H-1)&&(0<j<w-1)){
      |                                ^
a.cc:50:34: error: 'w' was not declared in this scope
   50 |           if((0<i+1<H-1)&&(0<j+1<w-1)){
      |                                  ^
a.cc:59:21: error: expected '}' at end of input
   59 |   cout << S << endl;
      |                     ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;

int main() {
	int H, W;

	cin >> H >> W;

	char mineField[H][W] = {};
	int counter[H][W] = {};
	

	for (int i = 0 ; i < H ; i++) {
		string s;
		cin >> s;
		for (int j = 0 ; j < W ; j++) {
			minField[i][j] = s.at(j);
		}
	}

	for (int s = 0 ; s < H ; s++) {
		for (int t = 0 ; t < W ; t++) {
			if (mineField[s][t] == '#') {

				if ( (s + 1 < H - 1) && (t + 1 < W - 1) ){
					if( mineField[s + 1][t + 1] == '.' ){
						counter[s + 1][t + 1]++;
					}
				}

				if ( s + 1 < H - 1 ){
					if( mineField[s + 1][t] == '.' ){
						counter[s + 1][t]++;
					}
				}

				if ((s + 1 < H - 1) && (t > 1) ){
					if( mineField[s + 1][t - 1] == '.' ){
						counter[s + 1][t - 1]++;
					}
				}

				if (t + 1 < W - 1) {
					if( mineField[s][t + 1] == '.' ){
						counter[s][t + 1]++;
					}
				}

				if (t > 1){
					if( mineField[s][t - 1] == '.' ){
						counter[s][t - 1]++;
					}
				}

				if ( (s > 1) && (t + 1 < W - 1) ){
					if( mineField[s - 1][t + 1] == '.' ){
						counter[s + 1][t + 1]++;
					}
				}

				if (s > 1) {
					if( mineField[s - 1][t] == '.' ){
						counter[s + 1][t]++;
					}
				}

				if (( s > 1 ) && (t > 1) ) {
					if( mineField[s - 1][t - 1] == '.' ){
						counter[s + 1][t - 1]++;
					}
				}
			}
		}
	}

	for (int s = 0 ; s < H ; s++) {
		for (int t = 0 ; t < W ; t++) {
			if (mineField[s][t] == '#') {
				cout << "#";
			} else {
				cout << counter[s][t];
			}
			cout << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:25: error: 'minField' was not declared in this scope; did you mean 'mineField'?
   31 |                         minField[i][j] = s.at(j);
      |                         ^~~~~~~~
      |                         mineField
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;

int main() {
	int H, W;
	char mineField[H][W] = {};
	int counter[H][W] = {};
	

	for (int i = 0 ; i < H ; i++) {
		cin >> mineField[i];
	}

	for (int s = 0 ; s < H ; s++) {
		for (int t = 0 ; t < W ; t++) {
			if (mineField[s][t] == '#') {

				if ( (s + 1 < H - 1) && (t + 1 < W - 1) ){
					if( mineField[s + 1][t + 1] == '.' ){
						counter[s + 1][t + 1]++;
					}
				}

				if ( s + 1 < H - 1 ){
					if( mineField[s + 1][t] == '.' ){
						counter[s + 1][t]++;
					}
				}

				if ((s + 1 < H - 1) && (t > 1) ){
					if( mineField[s + 1][t - 1] == '.' ){
						counter[s + 1][t - 1]++;
					}
				}

				if (t + 1 < W - 1) {
					if( mineField[s][t + 1] == '.' ){
						counter[s][t + 1]++;
					}
				}

				if (t > 1){
					if( mineField[s][t - 1] == '.' ){
						counter[s][t - 1]++;
					}
				}

				if ( (s > 1) && (t + 1 < W - 1) ){
					if( mineField[s - 1][t + 1] == '.' ){
						counter[s + 1][t + 1]++;
					}
				}

				if (s > 1) {
					if( mineField[s - 1][t] == '.' ){
						counter[s + 1][t]++;
					}
				}

				if (( s > 1 ) && (t > 1) ) {}
					if( mineField[s - 1][t - 1] == '.' ){
						counter[s + 1][t - 1]++;
					}
				}
			}
		}
	}

	for (int s = 0 ; s < H ; s++) {
		for (int t = 0 ; t < W ; t++) {
			if (mineField[s][t] == '#') {
				cout << "#";
			} else {
				cout << counter[s][t];
			}
			cout << endl;
		}
	}
}

Compiler output:
a.cc:83:9: error: expected unqualified-id before 'for'
   83 |         for (int s = 0 ; s < H ; s++) {
      |         ^~~
a.cc:83:26: error: 's' does not name a type
   83 |         for (int s = 0 ; s < H ; s++) {
      |                          ^
a.cc:83:34: error: 's' does not name a type
   83 |         for (int s = 0 ; s < H ; s++) {
      |                                  ^
a.cc:93:1: error: expected declaration before '}' token
   93 | }
      | ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main(){
  int h, w;
  cin >> h >> w;
  char s[h][w];
  int c[h][w];  
  for(int i = 0; i < h; ++i){
    for(int j = 0; j < w; ++j){
      cin >> s[i][j];
      c[i][j] = 0;        
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for(int i = 0; i < h; ++i){
    for(int j = 0; j < w; ++j){
      if(s[i][j] == '#'){
        for(int k = 0 ; k < 8; ++k){
          int deltaM = i + deltaArrayM[k];
          int deltaN = j + deltaArrayN[k];
          if ((deltaM < 0) || (deltaM > H) || (deltaN < 0) || (deltaN > W)) {
            continue;
          }
          if(s[deltaM][deltaN] != '#') {
            c[deltaM][deltaN] += 1;
          }
        }
      }     
    }
  }
  for(int i = 0; i < h; ++i){
    for(int j = 0; j < w; ++j){
      if(s[i][j] == '#')       
        cout << '#';
      else
        cout << c[i][j];
    }
    cout << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:24:41: error: 'H' was not declared in this scope
   24 |           if ((deltaM < 0) || (deltaM > H) || (deltaN < 0) || (deltaN > W)) {
      |                                         ^
a.cc:24:73: error: 'W' was not declared in this scope
   24 |           if ((deltaM < 0) || (deltaM > H) || (deltaN < 0) || (deltaN > W)) {
      |                                                                         ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main(){
  int h, w;
  cin >> h >> w;
  char s[h][w];
  int c[h][w];  
  for(int i = 0; i < h; ++i){
    for(int j = 0; j < w; ++j){
      cin >> s[i][j];
      c[i][j] = 0;        
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  int deltaM = i + deltaArrayM[k];
  int deltaN = j + deltaArrayN[k];
  for(int i = 0; i < h; ++i){
    for(int j = 0; j < w; ++j){
      if(s[i][j] == '#'){
        for(int k = 0 ; k < 8; ++k){
          deltaM = i + deltaArrayM[k];
          deltaN = j + deltaArrayN[k];
          if ((deltaM < 0) || (deltaM > H) || (deltaN < 0) || (deltaN > W)) {
            continue;
          }
          if(s[deltaM][deltaN] != '#') {
            c[deltaM][deltaN] += 1;
          }
        }
      }     
    }
  }
  for(int i = 0; i < h; ++i){
    for(int j = 0; j < w; ++j){
      if(s[i][j] == '#')       
        cout << '#';
      else
        cout << c[i][j];
    }
    cout << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: 'i' was not declared in this scope
   18 |   int deltaM = i + deltaArrayM[k];
      |                ^
a.cc:18:32: error: 'k' was not declared in this scope
   18 |   int deltaM = i + deltaArrayM[k];
      |                                ^
a.cc:19:16: error: 'j' was not declared in this scope
   19 |   int deltaN = j + deltaArrayN[k];
      |                ^
a.cc:26:41: error: 'H' was not declared in this scope
   26 |           if ((deltaM < 0) || (deltaM > H) || (deltaN < 0) || (deltaN > W)) {
      |                                         ^
a.cc:26:73: error: 'W' was not declared in this scope
   26 |           if ((deltaM < 0) || (deltaM > H) || (deltaN < 0) || (deltaN > W)) {
      |                                                                         ^
Language: C++

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

int main(){
  int H, W;
  cin >> H >> W;
  char s[H][W];
  int c[H][W];  
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      cin >> s[i][j];
      c[i][j] = 0;        
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (s[i][j] == '#') {
        for (int k = 0 ; k < 8; ++k){
          int deltaM = i + deltaArrayM[k];
          int deltaN = j + deltaArrayN[k];
          if ((deltaM < 0) || (deltaM > H) || (deltaN < 0) || (deltaN > W)) {
            continue;
          if (s[deltaM][deltaN] != '#') {
            c[deltaM][deltaN] += 1;
          }
        }
      }     
    }
  }
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (s[i][j] == '#') {   
        cout << "#";
      }
      else {
        cout << c[i][j];
    }
    cout << "\n";
    }
  }
}
  
  

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

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

int main(){
  int H, W;
  cin >> H >> W;
  char s[H][W];
  int c[H][W];  
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      cin >> s[i][j];
      c[i][j] = 0;        
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (s[i][j] == '#') {
        for (int k = 0 ; k < 8; ++k){
          int deltaM = i + deltaArrayM[k];
          int deltaN = j + deltaArrayN[k];
          if (s[deltaM][deltaN] != '#') {
            c[deltaM][deltaN] += 1;
          }
        }
      }     
    }
  }
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (s[i][j] == "#") {   
        cout << "#";
      }
      else {
        cout << c[i][j];
    }
    cout << "\n";
    }
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:33:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   33 |       if (s[i][j] == "#") {
      |           ~~~~~~~~^~~~~~
Language: C++

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

int main(){
  int H, W;
  cin >> H >> W;
  char s[H][W];
  int c[H][W];  
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      cin >> s[i][j];
      c[i][j] = 0;        
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (s[i][j] == '#') {
        for (int k = 0 ; k < 8; ++k){
          int deltaM = i + deltaArrayM[k];
          int deltaN = j + deltaArrayN[k];
          if (s[deltaM][deltaN] != '#') {
            c[deltaM][deltaN] += 1;
          }
        }
      }     
    }
  }
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (s[i][j] == "#") {   
        cout << "#";
      }
      else {
        cout << c[i][j];
    }
    cout << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:33:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   33 |       if (s[i][j] == "#") {
      |           ~~~~~~~~^~~~~~
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main(){
  int H, W;
  cin >> H >> W;
  char s[60][60];
  int c[60][60];  
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      cin >> s[i][j];
      if(s[i][j] == '.')
        c[i][j] = 0;        
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      if(s[i][j] == '#'){
        for(int k = 0 ; k < 8; ++k){
          int deltaM = i + deltaArrayM[k];
          int deltaN = j + deltaArrayN[k];
            if(s[deltaM][deltaN] != '#') {
              c[deltaM][deltaN] += 1;
            }
        }
      }     
    }
  }
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      if (s[i][j] == "#") {   
        cout << "#";
      }
      else {
        cout << c[i][j];
    }
    cout << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:34:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   34 |       if (s[i][j] == "#") {
      |           ~~~~~~~~^~~~~~
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main(){
  int H, W;
  cin >> H >> W;
  char s[H][W];
  int c[H][W];  
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      cin >> s[i][j];
      if(s[i][j] == '.')
        c[i][j] = 0;        
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      if(s[i][j] == '#'){
        for(int k = 0 ; k < 8; ++k){
          int deltaM = i + deltaArrayM[k];
          int deltaN = j + deltaArrayN[k];
            if(s[deltaM][deltaN] != '#') {
              c[deltaM][deltaN] += 1;
            }
        }
      }     
    }
  }
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      if (s[i][j] == "#") {   
        cout << "#";
      }
      else {
        cout << c[i][j];
    }
    cout << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:34:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   34 |       if (s[i][j] == "#") {
      |           ~~~~~~~~^~~~~~
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^