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

int main() {
  string board[50];
  int H, W;
  cin >> H >> W;

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


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

      int num = 0;
      for(int k = 0; k < 9; ++k) {
        int ni = i +k/3 -1;
        int nj = j +k%3 -1;
        if (ni < 0 || ni > H) continue;
        if (nj < 0 || nj > W) 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:2:3: error: 'string' was not declared in this scope
    2 |   string board[50];
      |   ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> H >> W;
      |   ^~~
a.cc:7:12: error: 'board' was not declared in this scope
    7 |     cin >> board[i];
      |            ^~~~~
a.cc:13:10: error: 'board' was not declared in this scope
   13 |       if(board[i][j] == '#') continue;
      |          ^~~~~
a.cc:21:13: error: 'board' was not declared in this scope
   21 |         if (board[ni][nj] == '#') ++num;
      |             ^~~~~
a.cc:23:7: error: 'board' was not declared in this scope
   23 |       board[i][j] = char(num + '0');
      |       ^~~~~
a.cc:27:30: error: 'cout' was not declared in this scope
   27 |   for(int i = 0; i < H; ++i) cout << board[i] << endl;
      |                              ^~~~
a.cc:27:38: error: 'board' was not declared in this scope
   27 |   for(int i = 0; i < H; ++i) cout << board[i] << endl;
      |                                      ^~~~~
a.cc:27:50: error: 'endl' was not declared in this scope
   27 |   for(int i = 0; i < H; ++i) cout << board[i] << endl;
      |                                                  ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>

using namespace std;

vector<string> split(string str) {
  vector<string> result;
  string substr;

  for (const char c : str) {
    substr += c;
    result.push_back(substr);
    substr.clear();
  }

  return result;
}

int calc_width_bom(vector <string> b, int w, int W) {
  int ret = 0;

  if (w==0) {
    ret += 0;
  }else {
    ret +=  (b[w-1] == "#") ? 1 : 0;
  }
  ret += (b[w  ] == "#") ? 1 : 0;
  if (w==(W-1)) {
    ret += 0;
  } else {
    ret += (b[w+1] == "#") ? 1 : 0;
  }

  return ret;
}


string calc_bom(vector<vector <string> > board, int h, int w, int H, int W) {

  int ym1;
  int y0;
  int yp1;

  y0  = calc_width_bom(board[h], w, W);
  if (h == 0) {
    ym1 = 0;
  } else {
    ym1 = calc_width_bom(board[h-1], w, W);
  }
  if (h == (H-1)) {
    yp1 = 0;
  } else {
    yp1 = calc_width_bom(board[h+1], w, W);
  }

  return to_string(ym1 + y0 + yp1);

}

#include <iostream>
#include <string>
#include <vector>

using namespace std;

vector<string> split(string str) {
  vector<string> result;
  string substr;

  for (const char c : str) {
    substr += c;
    result.push_back(substr);
    substr.clear();
  }

  return result;
}

int calc_width_bom(vector <string> b, int w, int W) {
  int ret = 0;

  if (w==0) {
    ret += 0;
  }else {
    ret +=  (b[w-1] == "#") ? 1 : 0;
  }
  ret += (b[w  ] == "#") ? 1 : 0;
  if (w==(W-1)) {
    ret += 0;
  } else {
    ret += (b[w+1] == "#") ? 1 : 0;
  }

  return ret;
}


string calc_bom(vector<vector <string> > board, int h, int w, int H, int W) {

  int ym1;
  int y0;
  int yp1;

  y0  = calc_width_bom(board[h], w, W);
  if (h == 0) {
    ym1 = 0;
  } else {
    ym1 = calc_width_bom(board[h-1], w, W);
  }
  if (h == (H-1)) {
    yp1 = 0;
  } else {
    yp1 = calc_width_bom(board[h+1], w, W);
  }

  return to_string(ym1 + y0 + yp1);

}


Compiler output:
a.cc:67:16: error: redefinition of 'std::vector<std::__cxx11::basic_string<char> > split(std::string)'
   67 | vector<string> split(string str) {
      |                ^~~~~
a.cc:7:16: note: 'std::vector<std::__cxx11::basic_string<char> > split(std::string)' previously defined here
    7 | vector<string> split(string str) {
      |                ^~~~~
a.cc:80:5: error: redefinition of 'int calc_width_bom(std::vector<std::__cxx11::basic_string<char> >, int, int)'
   80 | int calc_width_bom(vector <string> b, int w, int W) {
      |     ^~~~~~~~~~~~~~
a.cc:20:5: note: 'int calc_width_bom(std::vector<std::__cxx11::basic_string<char> >, int, int)' previously defined here
   20 | int calc_width_bom(vector <string> b, int w, int W) {
      |     ^~~~~~~~~~~~~~
a.cc:99:8: error: redefinition of 'std::string calc_bom(std::vector<std::vector<std::__cxx11::basic_string<char> > >, int, int, int, int)'
   99 | string calc_bom(vector<vector <string> > board, int h, int w, int H, int W) {
      |        ^~~~~~~~
a.cc:39:8: note: 'std::string calc_bom(std::vector<std::vector<std::__cxx11::basic_string<char> > >, int, int, int, int)' previously defined here
   39 | string calc_bom(vector<vector <string> > board, int h, int w, int H, int W) {
      |        ^~~~~~~~
Language: Java

import java.util.Scanner;

public class TestLocalDate {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int W = sc.nextInt();
        String[][] s = new String[N][W];
        for (int i=0; i<N; i++) {
            String row = sc.next();
            String[] cols = row.split("");
            for (int j=0; j<cols.length; j++) {
                s[i][j] = cols[j];
            }
        }
        String[][] t = new String[N][W];
        Integer[] dx = new Integer[]{0, 1, 0, -1, 1, 1, -1, -1};
        Integer[] dy = new Integer[]{1, 0, -1, 0, 1, -1, 1, -1};
        for (int i=0; i<N; i++) {
            for (int j = 0; j < W; j++) {
                if ("#".equals(s[i][j])) {
                    t[i][j] = "#";
                } else {
                    int cnt = 0;
                    for (int d=0; d<8; d++) {
                        int posx = i + dx[d];
                        int posy = j + dy[d];
                        if (0 <= posx && posx < N && 0 <= posy && posy < W) {
                            if ("#".equals(s[posx][posy]))
                                cnt++;
                        }
                    }
                    t[i][j] = String.valueOf(cnt);
                }
            }
        }
        for (int i=0; i<N; i++) {
            StringBuffer sb = new StringBuffer();
            for (int j = 0; j < W; j++) {
                sb.append(t[i][j]);
            }
            System.out.println(sb);
        }
    }
}


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

import java.util.Scanner;

public class TestLocalDate {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int W = sc.nextInt();
        String[][] s = new String[N][W];
        for (int i=0; i<N; i++) {
            String row = sc.next();
            String[] cols = row.split("");
            for (int j=0; j<cols.length; j++) {
                s[i][j] = cols[j];
            }
        }
        String[][] t = new String[N][W];
        Integer[] dx = new Integer[]{0, 1, 0, -1, 1, 1, -1, -1};
        Integer[] dy = new Integer[]{1, 0, -1, 0, 1, -1, 1, -1};
        for (int i=0; i<N; i++) {
            for (int j = 0; j < W; j++) {
                if ("#".equals(s[i][j])) {
                    t[i][j] = "#";
                } else {
                    int cnt = 0;
                    for (int d=0; d<8; d++) {
                        int posx = i + dx[d];
                        int posy = j + dy[d];
                        if (0 <= posx && posx < N && 0 <= posy && posy < W) {
                            if ("#".equals(s[posx][posy]))
                                cnt++;
                        }
                    }
                    t[i][j] = String.valueOf(cnt);
                }
            }
        }
        for (int i=0; i<N; i++) {
            StringBuffer sb = new StringBuffer();
            for (int j = 0; j < W; j++) {
                sb.append(t[i][j]);
            }
            System.out.println(sb);
        }
    }
}


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

#include <iostream>
using namespace std;
int main(void){
    int n,m;
    cin>>n>>m;
    char a[n+2][m+2];
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            cin>>a[i+1][j+1];
        }
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            if(a[i+1][j+1]==' ') continue;
            if(a[i+1][j+1]=='.'){
                int count=0;
                if(a[i+1][j]=='#') count++;
                if(a[i+1][j+2]=='#') count++;
                if(a[i][j+1]=='#') count++;
                if(a[i][j]=='#') count++;
                if(a[i+2][j+1]=='#') count++;
                if(a[i+2][j+2]=='#') count++;
                if(a[i+2][j]=='#') count++;
                if(a[i][j+2]=='#') count++;
                cout<<count;
            }else{ cout<<a[i+1][j+1];}
        }
        cout<<endl;
    }

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

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

int main() {
  int h,w;
  cin >> h >> w;
  string s[h];
  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]=='#') {
        cout << "#" << endl;
      }
      else {
        int cnt=0;
        for(int k=0; k<h; k++) {
          for(int l=0; l<w; l++) {
            if(s[k][l]==s[i-1][j-1]||s[k][l]==s[i-1][j]||s[k][l]==s[i-1][j+1]||s[i][j-1]||s[k][l]==s[i][j+1]||s[k][l]==s[i+1][j-1]||s[k][l]==s[i+1][j]||s[k][l]==s[i+1][j+1]) {
              cnt++;
            }
          }
        }
        cout << cnt;
      }
    }
    cout << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
int main() {
	int H,W;
	cin>>H>>W;
	for(int i=0; i<H; i++){
		string str[i];
		cin>>str[i];
	}
	
	for(int i=0; i<H; i++){
		for(int j=0; i<W; j++){
			if(str[i].at(j)=='#'){
				cout<<'#';
			}
			else{
				int A=0; //以降上から時計回り
				if(i>0&&str[i-1].at(j)==#){
					A++;
				}//上
				
				if(i>0&&(j<W-1)&&str[i].at(j)=='#'){
					A++;
				}
				
				if(j<W-1&&str[i].at(j+1)=='#'){
					A++;
				}//右
				
				if(i<H-1&&(j<W-1)&&str[i].at(j+1)=='#'){
					A++;
				}
				
				if(i<H-1&&str[i+1].at(j)=='#'){
					A++;
				}//下
				
				if(j>0&&(i<H-1)&&str[i].at(j+1)=='#'){
					A++;
				}
				
				
				if(j>0&&str[i].at(j-1)=='#'){
					A++;
				}//左
				
				if(j>0&&(i>0)&&str[i].at(j+1)=='#'){
					A++;
				}
				
				cout<<A;
				
			}
		}
		cout<<endl;
	}
}

Compiler output:
a.cc:18:57: error: stray '#' in program
   18 |                                 if(i>0&&str[i-1].at(j)==#){
      |                                                         ^
a.cc: In function 'int main()':
a.cc:13:28: error: 'str' was not declared in this scope; did you mean 'std'?
   13 |                         if(str[i].at(j)=='#'){
      |                            ^~~
      |                            std
a.cc:18:58: error: expected primary-expression before ')' token
   18 |                                 if(i>0&&str[i-1].at(j)==#){
      |                                                          ^
Language: C++


#include <bits/stdc++.h>
using namespace std;
int main() {
	int H,W;
	cin>>H>>W;
	for(int i=0; i<H; i++){
		string str[i];
		cin>>str[i];
	}
	
	for(int i=0; i<H; i++){
		for(int j=0; i<W; j++){
			if(str[i].at(j)=='#'){
				cout<<'#';
			}
			else{
				int A=0; //以降上から時計回り
				if(i>0&&str[i-1].at(j)==#){
					A++;
				}//上
				
				if(i>0&&j<W-1&&str[i].at(j)=='#'){
					A++;
				}
				
				if(j<W-1&&str[i].at(j+1)=='#'){
					A++;
				}//右
				
				if(i<H-1&&j<W-1&&str[i].at(j+1)=='#'){
					A++;
				}
				
				if(i<H-1&&str[i+1].at(j)=='#'){
					A++;
				}//下
				
				if(j>0&&i<H-1&&str[i].at(j+1)=='#'){
					A++;
				}
				
				
				if(j>0&&str[i].at(j-1)=='#'){
					A++;
				}//左
				
				if(j>0&&i>0&&str[i].at(j+1)=='#'){
					A++;
				}
				
				cout<<A;
				
			}
		}
		cout<<endl;
	}
}

Compiler output:
a.cc:19:57: error: stray '#' in program
   19 |                                 if(i>0&&str[i-1].at(j)==#){
      |                                                         ^
a.cc: In function 'int main()':
a.cc:14:28: error: 'str' was not declared in this scope; did you mean 'std'?
   14 |                         if(str[i].at(j)=='#'){
      |                            ^~~
      |                            std
a.cc:19:58: error: expected primary-expression before ')' token
   19 |                                 if(i>0&&str[i-1].at(j)==#){
      |                                                          ^
Language: C++

#include <bits/stdc++.h>
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};
 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 ni = i + dy[d];
 const int nj = 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:17:21: error: extended character ’ is not valid in an identifier
   17 |  if (board[i][j] == ’#’) continue;
      |                     ^
a.cc:17:22: error: stray '#' in program
   17 |  if (board[i][j] == ’#’) continue;
      |                      ^
a.cc:17:23: error: extended character ’ is not valid in an identifier
   17 |  if (board[i][j] == ’#’) continue;
      |                       ^
a.cc:26:23: error: extended character ’ is not valid in an identifier
   26 |  if (board[ni][nj] == ’#’) num++;
      |                       ^
a.cc:26:24: error: stray '#' in program
   26 |  if (board[ni][nj] == ’#’) num++;
      |                        ^
a.cc:26:25: error: extended character ’ is not valid in an identifier
   26 |  if (board[ni][nj] == ’#’) num++;
      |                         ^
a.cc:29:27: error: extended character ’ is not valid in an identifier
   29 |  board[i][j] = char(num + ’0’);
      |                           ^
a.cc:29:27: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:17:21: error: '\U00002019' was not declared in this scope
   17 |  if (board[i][j] == ’#’) continue;
      |                     ^
a.cc:17:22: error: expected ')' before '\U00002019'
   17 |  if (board[i][j] == ’#’) continue;
      |     ~                ^~
      |                      )
a.cc:26:23: error: '\U00002019' was not declared in this scope
   26 |  if (board[ni][nj] == ’#’) num++;
      |                       ^
a.cc:26:24: error: expected ')' before '\U00002019'
   26 |  if (board[ni][nj] == ’#’) num++;
      |     ~                  ^~
      |                        )
a.cc:29:27: error: '\U000020190\U00002019' was not declared in this scope
   29 |  board[i][j] = char(num + ’0’);
      |                           ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int H,W;
string board[50]
int dj[]={-1,-1,-1,0,0,1,1,1};
int di[]={-1,0,1,-1,1,-1,0,1};
int ni,nj,b;

int main(){
cin >>H >>W;
for (int i=0;i<H;i++)cin >>board[i];
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
	if(board[i][j]=='.'){
      b=0;
        for (int k=0;k<8;k++){
          ni=i+di[k];nj=j+dj[k];
          if(ni<0||nj<0||ni>=H||nj>=W)continue;
          if(board[ni][nj]=='#')b++;
        }
      board[i][j]='0'+b;   
      }
}}
  for(int i=0;;i<H;i++){cout <<board[i]<<endl;}
}

Compiler output:
a.cc:5:1: error: expected initializer before 'int'
    5 | int dj[]={-1,-1,-1,0,0,1,1,1};
      | ^~~
a.cc: In function 'int main()':
a.cc:11:28: error: 'board' was not declared in this scope
   11 | for (int i=0;i<H;i++)cin >>board[i];
      |                            ^~~~~
a.cc:14:12: error: 'board' was not declared in this scope
   14 |         if(board[i][j]=='.'){
      |            ^~~~~
a.cc:17:27: error: 'dj' was not declared in this scope; did you mean 'j'?
   17 |           ni=i+di[k];nj=j+dj[k];
      |                           ^~
      |                           j
a.cc:24:19: error: expected ')' before ';' token
   24 |   for(int i=0;;i<H;i++){cout <<board[i]<<endl;}
      |      ~            ^
      |                   )
a.cc:24:20: error: 'i' was not declared in this scope; did you mean 'ni'?
   24 |   for(int i=0;;i<H;i++){cout <<board[i]<<endl;}
      |                    ^
      |                    ni
Language: C++

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

int main(){
  int h,w;
  cin>>h>>w;
  int count=0;
  vector<string> s(h);
  for(int i=0;i<h;i++)
    cin>>s[i];
  for(int i=0;i<h;i++){
    count=0;
    for(int j=0;j<w;j++){
      if(s[i][j]=='.'){
        for(int k=-1;k<=1&&i+k<h;k++){
          for(int l=-1;l<=1&&j+k<w;l++){
            if(i==0) k=0;
            if(j==0) l=0;
            if(s[i+k][j+l]=='#')
              count++;
          }
        }
        s[i][j]=to_string(count);
      }
    }
  }
  for(int i=0;i<h;i++)
    cout<<s[i]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:26: 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
   23 |         s[i][j]=to_string(count);
      |                 ~~~~~~~~~^~~~~~~
      |                          |
      |                          std::string {aka std::__cxx11::basic_string<char>}
Language: C++

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

int main(){
  int h,w;
  cin>>h>>w;
  int count=0;
  vector<string> s(n);
  for(int i=0;i<h;i++)
    cin>>s[i];
  for(int i=0;i<h;i++){
    count=0;
    for(int j=0;j<w;j++){
      if(s[i][j]=='.'){
        for(int k=-1;k<=1&&i+k<h;k++){
          for(int l=-1;l<=1&&j+k<w;l++){
            if(i==0) k=0;
            if(j==0) l=0;
            if(s[i+k][j+l]=='#')
              count++;
          }
        }
        s[i][j]=to_string(count);
      }
    }
  }
  for(int i=0;i<h;i++)
    cout<<s[i]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: 'n' was not declared in this scope
    8 |   vector<string> s(n);
      |                    ^
a.cc:23:26: 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
   23 |         s[i][j]=to_string(count);
      |                 ~~~~~~~~~^~~~~~~
      |                          |
      |                          std::string {aka std::__cxx11::basic_string<char>}
Language: C++

#include <bits/stdc++.h>

using namespace std;
using llong = long long;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

int nw[9] = {0, 1, 0, -1, -1, 1, 1, -1, 0};
int nh[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};

int main(){
	int H,W;
	vector<string> s;

	cin >> H >> W;
	s.resize(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] == '#')
				cout << s[i][j]l;
			else{
				int num = 0;
				for(int k = 0; k < 8; k++)
					if(s[i+nh[k]][j+nw[k]] == '#')
						num++;
				cout << num;
			}
		}
		cout << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:48: error: expected ';' before 'l'
   27 |                                 cout << s[i][j]l;
      |                                                ^
      |                                                ;
Language: C++

#include<iostream>
using namespace std;

int main(){
  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};
  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 ni = i+dx[d];
        const int nj = j+dy[d];
        
        if(ni < 0 || h <= ni) continue;
        if(nj < 0 || w <= nj) continue;
        
        if(board[ni][nj] == "#") num++;
      }
      
      board[i][n] =char(num+"0");
      
    }
  }

  for(int i=0;i<h;i++) cout << board << endl;
  
  return 0;
}
        
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |       if(board[i][j]=="#") continue;
a.cc:27:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |         if(board[ni][nj] == "#") num++;
a.cc:30:16: error: 'n' was not declared in this scope
   30 |       board[i][n] =char(num+"0");
      |                ^
a.cc:30:20: error: cast from 'const char*' to 'char' loses precision [-fpermissive]
   30 |       board[i][n] =char(num+"0");
      |                    ^~~~~~~~~~~~~
Language: C++

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


int main() {
  int H, W;

  cin >> H >> W;

  string S[60];

  S[0] = ".";
  for(int i=1;i<W+2;i++){
    S[0] += ".";
  }
  
  for(int i=1;i<H+1;i++){
    cin >> S[i];
    S[i] = "." + S[i] + ".";
  }

  for(int i=1;i<H+1;i++){
    for(int j=1;j<W+1;j++){
      if(S[i][j]=="."){
        int count = 0;
        if(S[i-1][j-1]=="#") count++;
        if(S[i-1][j]=="#") count++;
        if(S[i-1][j+1]=="#") count++;
        if(S[i][j-1]=="#") count++;
        if(S[i][j+1]=="#") count++;
        if(S[i+1][j-1]=="#") count++;
        if(S[i+1][j]=="#") count++;
        if(S[i+1][j+1]=="#") count++;

        cout << count;
      }else{
        cout << "#";
      }
    }
    cout << endl;
  }


  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |       if(S[i][j]=="."){
a.cc:28:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   28 |         if(S[i-1][j-1]=="#") count++;
a.cc:29:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   29 |         if(S[i-1][j]=="#") count++;
a.cc:30:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |         if(S[i-1][j+1]=="#") count++;
a.cc:31:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   31 |         if(S[i][j-1]=="#") count++;
a.cc:32:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |         if(S[i][j+1]=="#") count++;
a.cc:33:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   33 |         if(S[i+1][j-1]=="#") count++;
a.cc:34:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   34 |         if(S[i+1][j]=="#") count++;
a.cc:35:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   35 |         if(S[i+1][j+1]=="#") count++;
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];
  
  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 ni=i+dy[d];
        const int 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:11:18: error: expected initializer before '==' token
   11 |   const int dx[8]== {1, 0, -1, 0, 1, -1, -1, 1};
      |                  ^~
a.cc:21:24: error: 'dx' was not declared in this scope; did you mean 'd'?
   21 |         const int nj=j+dx[d];
      |                        ^~
      |                        d
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];
  
  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;
      for(int d=0;d<8;d++){
        const int ni=i+dy[d];
        const int 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:11:18: error: expected initializer before '==' token
   11 |   const int dx[8]== {1, 0, -1, 0, 1, -1, -1, 1};
      |                  ^~
a.cc:21:24: error: 'dx' was not declared in this scope; did you mean 'd'?
   21 |         const int nj=j+dx[d];
      |                        ^~
      |                        d
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];
  
  const int dx[8]={0,0,0,1,1,1,-1,-1,-1};
  const int dy[8]={0,1,-1,0,1,-1,0,1,-1};
  
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(board[i][j]=="#")continue;
      
      int num;
      for(int d=0;d<8;d++){
        const int ni=i+dy[d];
        const int nj=j+dx[d];
        
        if(ni<0 || ni=>h)continue;
        if(nj<0 || nj=>w)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:10:40: error: too many initializers for 'const int [8]'
   10 |   const int dx[8]={0,0,0,1,1,1,-1,-1,-1};
      |                                        ^
a.cc:11:40: error: too many initializers for 'const int [8]'
   11 |   const int dy[8]={0,1,-1,0,1,-1,0,1,-1};
      |                                        ^
a.cc:15:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |       if(board[i][j]=="#")continue;
a.cc:22:23: error: expected primary-expression before '>' token
   22 |         if(ni<0 || ni=>h)continue;
      |                       ^
a.cc:23:23: error: expected primary-expression before '>' token
   23 |         if(nj<0 || nj=>w)continue;
      |                       ^
a.cc:24:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |         if(board[ni][nj]=="#")num++;
Language: C

#include <iostream>
#include <string>

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

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

    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(s[i][j] == '#') continue;
            int num = 0;
            for(int k = 0; k < 8; k++){
                if(i + dx[k] < 0 || i + dx[k] > w || j + dy[k] < 0 || j + dy[k] > h)continue;
                else if(s[i + dx[k]][j + dy[k]] == '#') num++;
            }
            s[i][j] = (char)(num + '0');
        }
    }
    for(int i = 0; i < h; i++) std::cout << s[i] << std::endl;
}

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

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) find(Range(c), x) != c.end()
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Vec2(T, n, m, xs) vector<vector<T>> xs(n, vector<T>(m))
#define Sum(a) accumulate(Range(a), 0)
#define Cusum(T, n, xs, sxs) vector<T> sxs(n+1); For(i, n) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, x) T x; cin >> x
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; For(i, n){ Cin(T, x); map[x] ++; }
#define Cout(x) cout << (x) << "\n"
#define Couts(xs) for(const auto &e : xs) cout << e << " "; cout << "\n"
#define Couty(cond) Cout((cond) ? "Yes" : "No")
#define CoutY(cond) Cout((cond) ? "YES" : "NO")

using namespace std;
using ll = long long;

int main(void){
  Cin(int, h);
  Cin(int, w);
  Cinss(char, h, w, s);
  For(i, h){
    For(j, w){
      if(s[i][j] == '.'){
        s[i][j] = '0';
        for(a, {-1, 0, 1}) for(b, {-1, 0, 1}){
          if(i+a >= 0 && i+a < h && j+b >= 0 && j+b < w && s[i+a][j+b] == '#'){
            s[i+a][j+b] ++;
          }
        }
      }
      cout << s[i][j];
    }
    cout << "\n";
  }  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:13: error: 'a' was not declared in this scope
   39 |         for(a, {-1, 0, 1}) for(b, {-1, 0, 1}){
      |             ^
a.cc:39:16: error: expected primary-expression before '{' token
   39 |         for(a, {-1, 0, 1}) for(b, {-1, 0, 1}){
      |                ^
a.cc:39:26: error: expected primary-expression before ')' token
   39 |         for(a, {-1, 0, 1}) for(b, {-1, 0, 1}){
      |                          ^
a.cc:39:26: error: expected ';' before ')' token
   39 |         for(a, {-1, 0, 1}) for(b, {-1, 0, 1}){
      |                          ^
      |                          ;
a.cc:39:32: error: 'b' was not declared in this scope
   39 |         for(a, {-1, 0, 1}) for(b, {-1, 0, 1}){
      |                                ^
a.cc:39:35: error: expected primary-expression before '{' token
   39 |         for(a, {-1, 0, 1}) for(b, {-1, 0, 1}){
      |                                   ^
a.cc:39:45: error: expected primary-expression before ')' token
   39 |         for(a, {-1, 0, 1}) for(b, {-1, 0, 1}){
      |                                             ^
a.cc:39:45: error: expected ';' before ')' token
   39 |         for(a, {-1, 0, 1}) for(b, {-1, 0, 1}){
      |                                             ^
      |                                             ;
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) find(Range(c), x) != c.end()
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Vec2(T, n, m, xs) vector<vector<T>> xs(n, vector<T>(m))
#define Sum(a) accumulate(Range(a), 0)
#define Cusum(T, n, xs, sxs) vector<T> sxs(n+1); For(i, n) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, x) T x; cin >> x
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; For(i, n){ Cin(T, x); map[x] ++; }
#define Cout(x) cout << (x) << "\n"
#define Couts(xs) for(const auto &e : xs) cout << e << " "; cout << "\n"
#define Couty(cond) Cout((cond) ? "Yes" : "No")
#define CoutY(cond) Cout((cond) ? "YES" : "NO")

using namespace std;
using ll = long long;

int main(void){
  Cin(int, h);
  Cin(int, w);
  Cinss(char, h, w, s);
  For(i, h){
    For(j, w){
      if(s[i][j] == '.'){
        s[i][j] = '0';
        For(a, {-1, 0, 1}) For(b, {-1, 0, 1}){
          if(i+a >= 0 && i+a < h && j+b >= 0 && j+b < w && s[i+a][j+b] == '#'){
            s[i+a][j+b] ++;
          }
        }
      }
      cout << s[i][j];
    }
    cout << "\n";
  }  
}


Compiler output:
a.cc:39:26: error: macro "For" passed 4 arguments, but takes just 2
   39 |         For(a, {-1, 0, 1}) For(b, {-1, 0, 1}){
      |                          ^
a.cc:8:9: note: macro "For" defined here
    8 | #define For(i, n) for(int i = 0; i < (n); i ++)
      |         ^~~
a.cc:39:45: error: macro "For" passed 4 arguments, but takes just 2
   39 |         For(a, {-1, 0, 1}) For(b, {-1, 0, 1}){
      |                                             ^
a.cc:8:9: note: macro "For" defined here
    8 | #define For(i, n) for(int i = 0; i < (n); i ++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:39:9: error: 'For' was not declared in this scope
   39 |         For(a, {-1, 0, 1}) For(b, {-1, 0, 1}){
      |         ^~~
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<char>> data(H, vector<char>(W));
  
  for (int i = 0; i < H ; i++){
    for( int j = 0 ;j < W ; j++){
      cin >> data.at(i).at(j);
      } // for j
    } //for i
  
  int count = 0;
  bool p = true;
  for (int i = -1; i < H + 1 ; i++){
    for( int j = -1; j < W + 1; j++){
      if ((data.at(i).at(j) == "")||(data.at(i).at(j) == '#')){        
        continue;
      }// if
      else{
        for ( int k = 0 ; k < 3; k++){
          for ( int l= 0; l < 3; l++){
            if (k == 1 && l == 1){
              continue;
              }// if
            else if (data.at(i+k).at(j+l) == '#'){
              count++;              
              }// elseif
            }//for l
         }//for k
        
        string c = to_string(count); 
        cout << c;
      }//else      
     } // for j
    cout << endl;
  } //for i
  
  
} //main



  

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

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

int main(){
  int R,H,W = 0;
  string New,Now,Old;
  cin >> H >> W >> New;
  Old = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  for(int i=0;i<H;i++){
    Now = New;
    New = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    if(i!=H-1)
      cin >> New;
    for(int j=0;j<W;j++){
      if(Now.at(j)=='.'){
        if(i!=0){
          if(Old.at(j)=='#')
            R++;
          
          if(j!=0){
            if(Old.at(j-1)=='#'){
              R++;
            }
          }
          
          if(j!=W-1){
            if(Old.at(j+1)=='#'){
              R++;
            }
          }
          
        }
        if(j!=0){
          if(Now.at(j-1)=='#')
            R++;
          if(New.at(j-1)=='#')
            R++;
        }
        if(j!=W-1){
          if(Now.at(j+1)=='#')
            R++;
          if(New.at(j+1)=='#')
            R++;
        }
        if(New.at(j+1)=='#')
          R++;
        
        Now.at(j)=R;
        R=0;
      }
    }
    //すべてのjに代入し終わったら
    cout << Now << endl;
    Old = Now;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:62: error: expected ';' before 'for'
    8 |   Old = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      |                                                              ^
      |                                                              ;
    9 |   for(int i=0;i<H;i++){
      |   ~~~                                                         
a.cc:9:15: error: 'i' was not declared in this scope
    9 |   for(int i=0;i<H;i++){
      |               ^
Language: C++

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

int main(){
  int H,W;
  cin >> H >> W;
  
  string board[55];
 
  for(int i  = 0;i<H;i++) 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;i<W;j++){
      if(board[i][j] == '#') continue;

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

        if(ni < 0 || h <= ni) continue;
        if(nj < 0 || w <= nj) continue;
      }
      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:25:22: error: 'h' was not declared in this scope
   25 |         if(ni < 0 || h <= ni) continue;
      |                      ^
a.cc:26:22: error: 'w' was not declared in this scope
   26 |         if(nj < 0 || w <= nj) continue;
      |                      ^
a.cc:33:17: error: 'h' was not declared in this scope
   33 |   for(int i=0;i<h;i++) cout << board[i] << endl;
      |                 ^
Language: C++

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

int main(){
  int H,W;
  cin >> H >> W;
  
  string board[55];
 
  for(int i  = 0;i<H;i++) 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;i<W;j++){
      if(board[i][j] == '#') continue;

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

        if(ni < 0 || h <= ni) continue;
        if(nj < 0 || w <= nj) continue;
      }
      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:26: error: expected ')' before numeric constant
   21 |       for(int d=0;d<8;d++0){
      |          ~               ^
      |                          )
a.cc:21:27: error: expected ';' before ')' token
   21 |       for(int d=0;d<8;d++0){
      |                           ^
      |                           ;
a.cc:33:17: error: 'h' was not declared in this scope
   33 |   for(int i=0;i<h;i++) cout << board[i] << endl;
      |                 ^
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:29:4: error: expected '}' at end of input
   29 |   }
      |    ^
a.cc:15:24: note: to match this '{'
   15 |   for(int i=1;i<=h;i++){
      |                        ^
a.cc:29:4: error: expected '}' at end of input
   29 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

int main(){
	int h,w,i,j,count=0;
  	char c[51][51];
  	cin>>h>>w;
  	
  	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			cin>>c[i][j];
        }
    }

  	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			if(c[i][j]=='.'){
              for(int k=i-1;k<=i+1;k++){
				for(int l=j-1;l<=j+1;l++){
					if(c[i][j]=='#'){
                      count++;
                    }
                }
              }
             cout<<'count ';
                  	count=0;
            }else{
			cout<<'# ';
            }
        }
  			cout<<endl;
    }


Compiler output:
a.cc:25:20: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   25 |              cout<<'count ';
      |                    ^~~~~~~~
a.cc:28:31: warning: multi-character character constant [-Wmultichar]
   28 |                         cout<<'# ';
      |                               ^~~~
a.cc: In function 'int main()':
a.cc:32:6: error: expected '}' at end of input
   32 |     }
      |      ^
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,i,j,count=0;
  	char[51][51];
  	cin>>h>>w;
  	
  	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			cin>>char[i][j];
        }
    }

  	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			if(char[i][j]=='.'){
              for(int k=i-1;k<=i+1;k++){
				for(int l=j-1;l<=j+1;l++){
					if(char[i][j]=='#'){
                      count++;
                    }
                }
              }
             cout<<'count ';
                  	count=0;
            }else{
			cout<<'# ';
            }
        }
  			cout<<endl;
    }

Compiler output:
a.cc:25:20: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   25 |              cout<<'count ';
      |                    ^~~~~~~~
a.cc:28:31: warning: multi-character character constant [-Wmultichar]
   28 |                         cout<<'# ';
      |                               ^~~~
a.cc: In function 'int main()':
a.cc:6:14: error: expected identifier before numeric constant
    6 |         char[51][51];
      |              ^~
a.cc:6:14: error: expected ']' before numeric constant
    6 |         char[51][51];
      |              ^~
      |              ]
a.cc:6:13: error: structured binding declaration cannot have type 'char'
    6 |         char[51][51];
      |             ^
a.cc:6:13: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:13: error: empty structured binding declaration
a.cc:6:17: error: expected initializer before '[' token
    6 |         char[51][51];
      |                 ^
a.cc:11:30: error: expected primary-expression before 'char'
   11 |                         cin>>char[i][j];
      |                              ^~~~
a.cc:17:32: error: expected unqualified-id before '[' token
   17 |                         if(char[i][j]=='.'){
      |                                ^
a.cc:20:48: error: expected unqualified-id before '[' token
   20 |                                         if(char[i][j]=='#'){
      |                                                ^
a.cc:32:6: error: expected '}' at end of input
   32 |     }
      |      ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

#inlcude<stdio.h>

int main(){
  char s[50][51];
  int H, W, a[50][50] = {0}, i, j;
  
  scanf("%d %d", &H, &W);
  
  for (i = 0; i < H; i++){
    scanf("%s", s[i]);
  }
  
  for (i = 0; i < H; i++){
    for(j = 0; j < W; j++){
      if(s[i][j] == '#'){
        a[i - 1][j - 1]++;
        a[i][j - 1]++;
        a[i + 1][j - 1]++;
        a[i - 1][j]++;
        a[i][j] = 9;
        a[i + 1][j]++;
        a[i - 1][j + 1]++;
        a[i][j + 1]++;
        a[i + 1][j + 1]++;
      }
    }
  }
  
  for (i = 0; i < H; i++){
    for(j = 0; j < W; j++){
      if(a[i][j] < 9){
        printf("%d", a[i][j]);
      } else {
        printf("#");
      }
    }
    printf("\n");
  }
  
  return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<stdio.h>
      |  ^~~~~~~
      |  include
main.c: In function 'main':
main.c:7:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 |   scanf("%d %d", &H, &W);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #inlcude<stdio.h>
main.c:7:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 |   scanf("%d %d", &H, &W);
      |   ^~~~~
main.c:7:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:32:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   32 |         printf("%d", a[i][j]);
      |         ^~~~~~
main.c:32:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:32:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:32:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:34:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   34 |         printf("#");
      |         ^~~~~~
main.c:34:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:37:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   37 |     printf("\n");
      |     ^~~~~~
main.c:37:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

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

char bomb(vector<string> box, int a, int b){
  int count = 0;
  
  if(box.at(a).at(b) == '#'){
    return '#;
  }else{
    for(int i=-1; i<=1; i++){
      for(int j=-1; j<=1; j++){
        if(a+i<0 or a+i>=box.size());
        else if(b+j<0 or b+j>=box.at(0).size());
        else if(i==0 and j==0);
        else if(box.at(a+i).at(b+j) == '#')
          count++;
        else;
      }
    }
    return (count-'0');
  }
}

int main(){
  int h,w; cin>>h>>w;
  vector<string>  strvec(h);
  for(int i=0; i<h; i++) 
    cin>>strvec.at(i);
  
  for(int i=0; i<h; i++){
    for(int j=0; j<w; j++){
      strvec.at(i).at(j) = bomb(strvec, i, j);
    }
    cout<<strvec.at(i)<<endl;
  }
}

Compiler output:
a.cc:8:12: warning: missing terminating ' character
    8 |     return '#;
      |            ^
a.cc:8:12: error: missing terminating ' character
    8 |     return '#;
      |            ^~~
a.cc: In function 'char bomb(std::vector<std::__cxx11::basic_string<char> >, int, int)':
a.cc:9:3: error: expected primary-expression before '}' token
    9 |   }else{
      |   ^
a.cc:8:11: error: expected ';' before '}' token
    8 |     return '#;
      |           ^
      |           ;
    9 |   }else{
      |   ~