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

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 nj = i+dy[d];
        const int nj = j=dx[d];
        
        if(ni <0orh <=ni) continue;
        if(nj <0orw <=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:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> h >> w;
      |   ^~~
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string board[50];
      |   ^~~~~~
a.cc:5:35: error: 'board' was not declared in this scope
    5 |     for(int i =0; i<h; ++i) cin >>board[i];
      |                                   ^~~~~
a.cc:12:10: error: 'board' was not declared in this scope
   12 |       if(board[i][j] == '#') continue;
      |          ^~~~~
a.cc:17:19: error: redeclaration of 'const int nj'
   17 |         const int nj = j=dx[d];
      |                   ^~
a.cc:16:19: note: 'const int nj' previously declared here
   16 |         const int nj = i+dy[d];
      |                   ^~
a.cc:19:12: error: 'ni' was not declared in this scope; did you mean 'nj'?
   19 |         if(ni <0orh <=ni) continue;
      |            ^~
      |            nj
a.cc:19:16: error: unable to find numeric literal operator 'operator""orh'
   19 |         if(ni <0orh <=ni) continue;
      |                ^~~~
a.cc:20:16: error: unable to find numeric literal operator 'operator""orw'
   20 |         if(nj <0orw <=nj) continue;
      |                ^~~~
a.cc:22:12: error: 'board' was not declared in this scope
   22 |         if(board[ni][nj] == '#') num++;
      |            ^~~~~
a.cc:22:18: error: 'ni' was not declared in this scope; did you mean 'nj'?
   22 |         if(board[ni][nj] == '#') num++;
      |                  ^~
      |                  nj
a.cc:26:7: error: 'board' was not declared in this scope
   26 |       board[i][j] = char(num+'0');
      |       ^~~~~
a.cc:31:30: error: 'cout' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                              ^~~~
a.cc:31:38: error: 'board' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                                      ^~~~~
a.cc:31:50: error: 'endl' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                                                  ^~~~
Language: C++

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 nj = i+dy[d];
        const int nj = j=dx[d];
        
        if(nj <0orh <=nj) continue;
        if(nj <0orw <=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:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> h >> w;
      |   ^~~
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string board[50];
      |   ^~~~~~
a.cc:5:35: error: 'board' was not declared in this scope
    5 |     for(int i =0; i<h; ++i) cin >>board[i];
      |                                   ^~~~~
a.cc:12:10: error: 'board' was not declared in this scope
   12 |       if(board[i][j] == '#') continue;
      |          ^~~~~
a.cc:17:19: error: redeclaration of 'const int nj'
   17 |         const int nj = j=dx[d];
      |                   ^~
a.cc:16:19: note: 'const int nj' previously declared here
   16 |         const int nj = i+dy[d];
      |                   ^~
a.cc:19:16: error: unable to find numeric literal operator 'operator""orh'
   19 |         if(nj <0orh <=nj) continue;
      |                ^~~~
a.cc:20:16: error: unable to find numeric literal operator 'operator""orw'
   20 |         if(nj <0orw <=nj) continue;
      |                ^~~~
a.cc:22:12: error: 'board' was not declared in this scope
   22 |         if(board[ni][nj] == '#') num++;
      |            ^~~~~
a.cc:22:18: error: 'ni' was not declared in this scope; did you mean 'nj'?
   22 |         if(board[ni][nj] == '#') num++;
      |                  ^~
      |                  nj
a.cc:26:7: error: 'board' was not declared in this scope
   26 |       board[i][j] = char(num+'0');
      |       ^~~~~
a.cc:31:30: error: 'cout' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                              ^~~~
a.cc:31:38: error: 'board' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                                      ^~~~~
a.cc:31:50: error: 'endl' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                                                  ^~~~
Language: C++

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 dx[8] = {0,1,0,-1,1,1,-1,-1};
  
  for(int i = 0; i < h; ++i) {
    for(int j = 0; j<w; ++j) {
      if(board[i][j] == '#') continue;
      
      int num = 0;
      for(int d=0; d<8; ++d) {
        const int nj = i+dy[d];
        const int nj = j=dx[d];
        
        if(nj <0orh <=nj) continue;
        if(nj <0orw <=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:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> h >> w;
      |   ^~~
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string board[50];
      |   ^~~~~~
a.cc:5:35: error: 'board' was not declared in this scope
    5 |     for(int i =0; i<h; ++i) cin >>board[i];
      |                                   ^~~~~
a.cc:8:13: error: redeclaration of 'const int dx [8]'
    8 |   const int dx[8] = {0,1,0,-1,1,1,-1,-1};
      |             ^~
a.cc:7:13: note: 'const int dx [8]' previously declared here
    7 |   const int dx[8] = {1,0,-1,0,1,-1,-1,1};
      |             ^~
a.cc:12:10: error: 'board' was not declared in this scope
   12 |       if(board[i][j] == '#') continue;
      |          ^~~~~
a.cc:16:26: error: 'dy' was not declared in this scope; did you mean 'd'?
   16 |         const int nj = i+dy[d];
      |                          ^~
      |                          d
a.cc:17:19: error: redeclaration of 'const int nj'
   17 |         const int nj = j=dx[d];
      |                   ^~
a.cc:16:19: note: 'const int nj' previously declared here
   16 |         const int nj = i+dy[d];
      |                   ^~
a.cc:19:16: error: unable to find numeric literal operator 'operator""orh'
   19 |         if(nj <0orh <=nj) continue;
      |                ^~~~
a.cc:20:16: error: unable to find numeric literal operator 'operator""orw'
   20 |         if(nj <0orw <=nj) continue;
      |                ^~~~
a.cc:22:12: error: 'board' was not declared in this scope
   22 |         if(board[ni][nj] == '#') num++;
      |            ^~~~~
a.cc:22:18: error: 'ni' was not declared in this scope; did you mean 'nj'?
   22 |         if(board[ni][nj] == '#') num++;
      |                  ^~
      |                  nj
a.cc:26:7: error: 'board' was not declared in this scope
   26 |       board[i][j] = char(num+'0');
      |       ^~~~~
a.cc:31:30: error: 'cout' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                              ^~~~
a.cc:31:38: error: 'board' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                                      ^~~~~
a.cc:31:50: error: 'endl' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                                                  ^~~~
Language: C++

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 dx[8] = {0,1,0,-1,1,1,-1,-1};
  
  for(int i = 0; i < h; ++i) {
    for(int j = 0; j<w; ++j) {
      if(board[i][j] == '#') continue;
      
      int num = 0;
      for(int d=0; d<8; ++d) {
        const int nj = i+dy[d];
        const int nj = j=dx[d];
        
        if(nj <0orh <=nj) continue;
        if(nj <0orw <=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:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> h >> w;
      |   ^~~
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string board[50]
      |   ^~~~~~
a.cc:5:19: error: 'i' was not declared in this scope
    5 |     for(int i =0; i<h; ++i) cin >>board[i];
      |                   ^
a.cc:8:13: error: redeclaration of 'const int dx [8]'
    8 |   const int dx[8] = {0,1,0,-1,1,1,-1,-1};
      |             ^~
a.cc:7:13: note: 'const int dx [8]' previously declared here
    7 |   const int dx[8] = {1,0,-1,0,1,-1,-1,1};
      |             ^~
a.cc:12:10: error: 'board' was not declared in this scope
   12 |       if(board[i][j] == '#') continue;
      |          ^~~~~
a.cc:16:26: error: 'dy' was not declared in this scope; did you mean 'd'?
   16 |         const int nj = i+dy[d];
      |                          ^~
      |                          d
a.cc:17:19: error: redeclaration of 'const int nj'
   17 |         const int nj = j=dx[d];
      |                   ^~
a.cc:16:19: note: 'const int nj' previously declared here
   16 |         const int nj = i+dy[d];
      |                   ^~
a.cc:19:16: error: unable to find numeric literal operator 'operator""orh'
   19 |         if(nj <0orh <=nj) continue;
      |                ^~~~
a.cc:20:16: error: unable to find numeric literal operator 'operator""orw'
   20 |         if(nj <0orw <=nj) continue;
      |                ^~~~
a.cc:22:12: error: 'board' was not declared in this scope
   22 |         if(board[ni][nj] == '#') num++;
      |            ^~~~~
a.cc:22:18: error: 'ni' was not declared in this scope; did you mean 'nj'?
   22 |         if(board[ni][nj] == '#') num++;
      |                  ^~
      |                  nj
a.cc:26:7: error: 'board' was not declared in this scope
   26 |       board[i][j] = char(num+'0');
      |       ^~~~~
a.cc:31:30: error: 'cout' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                              ^~~~
a.cc:31:38: error: 'board' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                                      ^~~~~
a.cc:31:50: error: 'endl' was not declared in this scope
   31 |   for(int i = 0; i < h; ++i) cout << board[i] << endl;
      |                                                  ^~~~
Language: C++

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[i][j];
        }
    }
    int dx[8]={0,1,1,1,0,-1,-1,-1};
    int dy[8]={1,1,0,-1,-1,-1,0,1};
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(S[i][j]=='#'){
                cout<<'#';
            }
            else{
                int count=0;
                for(int k=0;k<8;k++) {
                    int nx = j + dx[k];
                    int ny = i + dy[k];
                    if(0<=nx&&nx<H&&0<=ny&&ny<W){
                        if(S[ny][nx]=='#') {
                            count++;
                        }
                    }
                }
                cout<<count;
            }
        }
        cout<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:14: error: 'cin' was not declared in this scope
    2 |     int H,W; cin>>H>>W;
      |              ^~~
a.cc:3:5: error: 'vector' was not declared in this scope
    3 |     vector<vector<char>>S(H,vector<char>(W));
      |     ^~~~~~
a.cc:3:19: error: expected primary-expression before 'char'
    3 |     vector<vector<char>>S(H,vector<char>(W));
      |                   ^~~~
a.cc:6:18: error: 'S' was not declared in this scope
    6 |             cin>>S[i][j];
      |                  ^
a.cc:13:16: error: 'S' was not declared in this scope
   13 |             if(S[i][j]=='#'){
      |                ^
a.cc:14:17: error: 'cout' was not declared in this scope
   14 |                 cout<<'#';
      |                 ^~~~
a.cc:27:17: error: 'cout' was not declared in this scope; did you mean 'count'?
   27 |                 cout<<count;
      |                 ^~~~
      |                 count
a.cc:30:9: error: 'cout' was not declared in this scope
   30 |         cout<<endl;
      |         ^~~~
a.cc:30:15: error: 'endl' was not declared in this scope
   30 |         cout<<endl;
      |               ^~~~
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<0orh<=ni)continue;
 if(nj<0orw<=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:15:21: error: extended character ’ is not valid in an identifier
   15 |  if (board[i][j] == ’#’) continue;
      |                     ^
a.cc:15:22: error: stray '#' in program
   15 |  if (board[i][j] == ’#’) continue;
      |                      ^
a.cc:15:23: error: extended character ’ is not valid in an identifier
   15 |  if (board[i][j] == ’#’) continue;
      |                       ^
a.cc:24:23: error: extended character ’ is not valid in an identifier
   24 |  if (board[ni][nj] == ’#’) num++;
      |                       ^
a.cc:24:24: error: stray '#' in program
   24 |  if (board[ni][nj] == ’#’) num++;
      |                        ^
a.cc:24:25: error: extended character ’ is not valid in an identifier
   24 |  if (board[ni][nj] == ’#’) num++;
      |                         ^
a.cc:27:27: error: extended character ’ is not valid in an identifier
   27 |  board[i][j] = char(num + ’0’);
      |                           ^
a.cc:27:27: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:15:21: error: '\U00002019' was not declared in this scope
   15 |  if (board[i][j] == ’#’) continue;
      |                     ^
a.cc:15:22: error: expected ')' before '\U00002019'
   15 |  if (board[i][j] == ’#’) continue;
      |     ~                ^~
      |                      )
a.cc:22:8: error: unable to find numeric literal operator 'operator""orh'
   22 |  if(ni<0orh<=ni)continue;
      |        ^~~~
a.cc:23:8: error: unable to find numeric literal operator 'operator""orw'
   23 |  if(nj<0orw<=nj)continue;
      |        ^~~~
a.cc:24:23: error: '\U00002019' was not declared in this scope
   24 |  if (board[ni][nj] == ’#’) num++;
      |                       ^
a.cc:24:24: error: expected ')' before '\U00002019'
   24 |  if (board[ni][nj] == ’#’) num++;
      |     ~                  ^~
      |                        )
a.cc:27:27: error: '\U000020190\U00002019' was not declared in this scope
   27 |  board[i][j] = char(num + ’0’);
      |                           ^~~
Language: C++

#include <iostream>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#define rep(i,n) for(int i = 0; i < n;i++)
#define ll long long
#include <bits/stdc++.h>
using namespace std;
#define mo 1000000007
#define ull unsigned long long 

int main(){
  int h,w;cin>>h>>w;
  vector<vector<int>> data(h+2, vector<int>(w+2));
  for(int i=1;i<h+1;i++){
    string s;cin>>s;
    for(int j=1;j<w+1;j++){
      if(s.at(j-1)=="#"){
        //上
        data.at(i-1).at(j-1)++;
        data.at(i-1).at(j)++;
        data.at(i-1).at(j+1)++;
        //同じ列
        data.at(i).at(j-1)++;
        data.at(i).at(j+1)++;
        //下
        data.at(i+1).at(j-1)++;
        data.at(i+1).at(j)++;
        data.at(i+1).at(j+1)++;
      }
    }
  }
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++){
      cout<<data.at(i).at(j);
      if(j==w)
        cout<<endl;
    }
  }
}
      
    

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

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

int main(){
  int h,w;
  cin >> h >> w;
  
  string board[h];
  for(int i=0;i<h;i++) cin >> s[i];
   int dx[8] = {1,0,-1,0,1,-1,-1,1};
   int dy[8] = {0,1,0,-1,1,1,-1,-1};
  
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(board[i][j] == '#')continue;
      
      int num = 0;
      for(int d=0;d<8;++d){
         int ni = i+dy[d];
         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:10:31: error: 's' was not declared in this scope
   10 |   for(int i=0;i<h;i++) cin >> s[i];
      |                               ^
Language: C++

#include<bits/stdc++.h>
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;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 = i +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:27:7: error: expected primary-expression before '}' token
   27 |       }
      |       ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll h,w;
  cin>>h>>w;
  vstr s(h);
  for(int i=0;i<h;i++){
    cin>>s[i];
  }
  vector<vector<char>> ans(h,vector<char>(w));
  rep(i,h)rep(j,w){
    if(s[i][j]=='#') ans[i][j]='#';
    else{
      ll k=0;
      if(i-1>=0&&j-1>0){
        if(s[i-1][j-1]=='#') k++;
      }
      if(i-1>=0){
        if(s[i-1][j]=='#') k++;
      }
      if(i-1>=0&&j+1<w){
        if(s[i-1][j+1]=='#') k++;
      }
      if(j-1>0){
        if(s[i][j-1]=='#') k++;
      }
      if(j+1<w){
        if(s[i][j+1]=='#') k++;
      }
      if(i+1<h&&j-1>0){
        if(s[i+1][j-1]=='#') k++;
      }
      if(i+1<h){
        if(s[i+1][j]=='#') k++;
      }
      if(i+1<w&&j+1<h){
        if(s[i+1][j+1]=='#') k++;
      }
      ans[i][j]=k;
    }
  }
  rep(i,h){
    rep(i,w){
      cout<<ans[i][j];
    }
    cout<<endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:77:20: error: 'j' was not declared in this scope
   77 |       cout<<ans[i][j];
      |                    ^
Language: C++

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

int main() {
    int H,W;
    cin >> H >> W;
    string S[W];
    for(int i = 0; i < H; ++i) cin >> S[i];

    //*def vector
    const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
    const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

    int num;
    for(int i = 0; i < H; ++i){
        for(int j = 0; j < W; ++j){
            //each cell
            if(S[i][j] == '#') continue;

            //count
            num = 0;
            //with vector
            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 (S[ni][nj] == ’#’) num++;
            }
            S[i][j] = char(num + ’0’);
            //for(int k = i-1; k <= i+1; ++k){
            //    if(k < 0 || k >= H) continue;
            //    for(int l = j-1; l <= j+1; ++l){
            //        if(l < 0 || l >= W) continue;
            //        if(S[k][l] == '#') num++;
            //    }
            //}
            //S[i][j] = '0' + num;
        }
    }
    for(int i = 0; i < H; ++i) cout << S[i] << endl;
}

Compiler output:
a.cc:29:34: error: extended character ’ is not valid in an identifier
   29 |                 if (S[ni][nj] == ’#’) num++;
      |                                  ^
a.cc:29:35: error: stray '#' in program
   29 |                 if (S[ni][nj] == ’#’) num++;
      |                                   ^
a.cc:29:36: error: extended character ’ is not valid in an identifier
   29 |                 if (S[ni][nj] == ’#’) num++;
      |                                    ^
a.cc:31:34: error: extended character ’ is not valid in an identifier
   31 |             S[i][j] = char(num + ’0’);
      |                                  ^
a.cc:31:34: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:29:34: error: '\U00002019' was not declared in this scope
   29 |                 if (S[ni][nj] == ’#’) num++;
      |                                  ^
a.cc:29:35: error: expected ')' before '\U00002019'
   29 |                 if (S[ni][nj] == ’#’) num++;
      |                    ~              ^~
      |                                   )
a.cc:31:34: error: '\U000020190\U00002019' was not declared in this scope
   31 |             S[i][j] = char(num + ’0’);
      |                                  ^~~
Language: C++

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

int main() {
    int H,W;
    cin >> H >> W;
    string S[W];
    for(int i = 0; i < H; ++i) cin >> S[i];

    //*def vector
    const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
    const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

    int num;
    for(int i = 0; i < H; ++i){
        for(int j = 0; j < W; ++j){
            //each cell
            if(S[i][j] == '#') continue;

            //count
            num = 0;
            //with vector
            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 (S[ni][nj] == ’#’) num++;
            }
            S[i][j] = char(num + ’0’);
            //for(int k = i-1; k <= i+1; ++k){
            //    if(k < 0 || k >= H) continue;
            //    for(int l = j-1; l <= j+1; ++l){
            //        if(l < 0 || l >= W) continue;
            //        if(S[k][l] == '#') num++;
            //    }
            //}
            //S[i][j] = '0' + num;
        }
    }
    for(int i = 0; i < H; ++i) cout << S[i] << endl;
}

Compiler output:
a.cc:29:34: error: extended character ’ is not valid in an identifier
   29 |                 if (S[ni][nj] == ’#’) num++;
      |                                  ^
a.cc:29:35: error: stray '#' in program
   29 |                 if (S[ni][nj] == ’#’) num++;
      |                                   ^
a.cc:29:36: error: extended character ’ is not valid in an identifier
   29 |                 if (S[ni][nj] == ’#’) num++;
      |                                    ^
a.cc:31:34: error: extended character ’ is not valid in an identifier
   31 |             S[i][j] = char(num + ’0’);
      |                                  ^
a.cc:31:34: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:27:31: error: 'h' was not declared in this scope
   27 |                 if (ni < 0 or h <= ni) continue;
      |                               ^
a.cc:28:31: error: 'w' was not declared in this scope
   28 |                 if (nj < 0 or w <= nj) continue;
      |                               ^
a.cc:29:34: error: '\U00002019' was not declared in this scope
   29 |                 if (S[ni][nj] == ’#’) num++;
      |                                  ^
a.cc:29:35: error: expected ')' before '\U00002019'
   29 |                 if (S[ni][nj] == ’#’) num++;
      |                    ~              ^~
      |                                   )
a.cc:31:34: error: '\U000020190\U00002019' was not declared in this scope
   31 |             S[i][j] = char(num + ’0’);
      |                                  ^~~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int main() {
  int h, w;
  cin >> h >> w;
  vector<string> v(h);
  vector<vector<char>> r(h, vector<char>(w));
  rep(i, h) cin >> v[i];
  rep(i, h){
    rep(j, w){
      if(v[i][j] == '#') r[i][j] = '#';
      else{
        int c = 0;
        for(int k = max(0, i-1); k < min(h, i+2); ++k){
          for(int l = max(0, j-1); l < min(w, j+2); ++l){
            if(v[k][l] == '#') ++c;
          }
        }
        r[i][j] = c;
      }
    }
  }
  rep(i, h){
    rep(j, ww) cout << r[i][j];
    cout << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: 'ww' was not declared in this scope; did you mean 'w'?
   27 |     rep(j, ww) cout << r[i][j];
      |            ^~
a.cc:3:38: note: in definition of macro 'rep'
    3 | #define rep(i, n) for(int i = 0; i < n; ++i)
      |                                      ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main() {
  int H,W;
  char S[53][53];
  cin >> H >> W;
  for (int j=0;j<W+2;++j) {
    S[0][j] = ' ';
  }
  for (int i=1;i<H+1;++i) {
    S[i][0] = ' ';
    cin >> S[i];
    S[i][W+1] = ' ';
  }
  for (int i=1;i<=H;++i) {
    for (int j=1;j<=W;++j) {
      int count = 0;
      if (S[i][j] == '#') {
        continue;
      }
      for (int k=0;k<3;++k) {
        for (int l=0;l<3;++l) {
          if (S[i-1+k][j-1+l] == '#') {
            ++count;
          }
        }
      }
      S[i][j] = to_string(count).c_str();
    }
    cout << S[i];
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:39: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   31 |       S[i][j] = to_string(count).c_str();
      |                 ~~~~~~~~~~~~~~~~~~~~~~^~
      |                                       |
      |                                       const char*
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main() {
  int H,W;
  char S[53][53];
  cin >> H >> W;
  for (int j=0;j<W+2;++j) {
    S[0][j] = ' ';
  }
  for (int i=1;i<H+1;++i) {
    S[i][0] = " ";
    cin >> setw(W) >> S[i];
    S[i][W+1] = " ";
  }
  for (int i=1;i<=H;++i) {
    for (int j=1;j<=W;++j) {
      int count = 0;
      if (S[i][j] == '#') {
        continue;
      }
      for (int k=0;k<3;++k) {
        for (int l=0;l<3++l) {
          if (S[i-1+k][j-1+l] == '#') {
            ++count;
          }
        }
      }
      S[i][j] = stoi(count);
    }
    cout << S[i];
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   14 |     S[i][0] = " ";
      |               ^~~
      |               |
      |               const char*
a.cc:15:12: error: 'setw' was not declared in this scope
   15 |     cin >> setw(W) >> S[i];
      |            ^~~~
a.cc:2:1: note: 'std::setw' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include <iostream>
  +++ |+#include <iomanip>
    2 | #include <string>
a.cc:16:17: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   16 |     S[i][W+1] = " ";
      |                 ^~~
      |                 |
      |                 const char*
a.cc:25:24: error: lvalue required as increment operand
   25 |         for (int l=0;l<3++l) {
      |                        ^
a.cc:25:27: error: expected ';' before 'l'
   25 |         for (int l=0;l<3++l) {
      |                           ^
      |                           ;
a.cc:31:21: error: no matching function for call to 'stoi(int&)'
   31 |       S[i][j] = stoi(count);
      |                 ~~~~^~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

char a[1005][1005];

int main(){
int m, n, res = 0;
cin » n » m;
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
cin » a[i][j];
}
}
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
res = 0;
if(a[i][j] == '#'){
cout « '#';
continue;
}
if(a[i][j + 1] == '#') res++;
if(a[i][j - 1] == '#') res++;
if(a[i + 1][j] == '#') res++;
if(a[i - 1][j] == '#') res++;
if(a[i + 1][j + 1] == '#') res++;
if(a[i - 1][j - 1] == '#') res++;
if(a[i + 1][j - 1] == '#') res++;
if(a[i - 1][j + 1] == '#') res++;
cout « res;
}
cout « "\n";
}
return 0;
}

Compiler output:
a.cc:9:5: error: extended character » is not valid in an identifier
    9 | cin » n » m;
      |     ^
a.cc:9:9: error: extended character » is not valid in an identifier
    9 | cin » n » m;
      |         ^
a.cc:12:5: error: extended character » is not valid in an identifier
   12 | cin » a[i][j];
      |     ^
a.cc:19:6: error: extended character « is not valid in an identifier
   19 | cout « '#';
      |      ^
a.cc:30:6: error: extended character « is not valid in an identifier
   30 | cout « res;
      |      ^
a.cc:32:6: error: extended character « is not valid in an identifier
   32 | cout « "\n";
      |      ^
a.cc: In function 'int main()':
a.cc:9:4: error: expected ';' before '\U000000bb'
    9 | cin » n » m;
      |    ^~
      |    ;
a.cc:12:4: error: expected ';' before '\U000000bb'
   12 | cin » a[i][j];
      |    ^~
      |    ;
a.cc:19:5: error: expected ';' before '\U000000ab'
   19 | cout « '#';
      |     ^~
      |     ;
a.cc:30:5: error: expected ';' before '\U000000ab'
   30 | cout « res;
      |     ^~
      |     ;
a.cc:32:5: error: expected ';' before '\U000000ab'
   32 | cout « "\n";
      |     ^~
      |     ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a;i<(int)b;++i)
int main(){
  int h,w;cin>>h>>w;
  vector<string> f(h);
  rep(i,h)cin>>f[i];
  rep(i,h)rep(j,w){
    if(f[i][j]=="."){
      int cnt=0;
      if(i<h-1&&f[i+1][j]=="#")cnt++;
      if(j<w-1&&f[i][j+1]=="#")cnt++;
      if(i>0&&f[i-1][j]=="#")cnt++;
      if(j>0&&f[i][j-1]=="#")cnt++;
      if(i<h-1&&j<w-1&&f[i+1][j+1]=="#")cnt++;
      if(i<h-1&&j>0&&f[i+1][j-1]=="#")cnt++;
      if(i>0&&j<w-1&&f[i-1][j+1]=="#")cnt++;
      if(i>0&&j>0&&f[i-1][j-1]=="#")cnt++;
      f[i][j]=(char)cnt;
    }
  }
  rep(i,h)cout<<f[i]<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(f[i][j]=="."){
a.cc:13:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |       if(i<h-1&&f[i+1][j]=="#")cnt++;
a.cc:14:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |       if(j<w-1&&f[i][j+1]=="#")cnt++;
a.cc:15:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |       if(i>0&&f[i-1][j]=="#")cnt++;
a.cc:16:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |       if(j>0&&f[i][j-1]=="#")cnt++;
a.cc:17:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |       if(i<h-1&&j<w-1&&f[i+1][j+1]=="#")cnt++;
a.cc:18:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |       if(i<h-1&&j>0&&f[i+1][j-1]=="#")cnt++;
a.cc:19:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |       if(i>0&&j<w-1&&f[i-1][j+1]=="#")cnt++;
a.cc:20:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |       if(i>0&&j>0&&f[i-1][j-1]=="#")cnt++;
Language: C++

#include <bits/stdc++.h>
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];
        
         // out of bounds 防止
         if (ni < 0 or H <= ni ) continue;
         if (nj < 0 or W <= nj ) continue;
         if (board[ni][nj] == '#' ) num++;
      }

         
    }
      board[i][j] = char(num + '0');
  }
    
  for (int i = 0; i < H; ++i) cout << board[i] << endl;
  
  return 0;
}
  



Compiler output:
a.cc: In function 'int main()':
a.cc:33:16: error: 'j' was not declared in this scope
   33 |       board[i][j] = char(num + '0');
      |                ^
a.cc:33:26: error: 'num' was not declared in this scope; did you mean 'enum'?
   33 |       board[i][j] = char(num + '0');
      |                          ^~~
      |                          enum
Language: C++

#include <bits/stdc++.h>
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];
        
         // out of bounds 防止
         if (ni < 0 or H <= ni ) continue;
         if (nj < 0 or W <= nj ) continue;
         if (board[ni][nj] == '#' ) num++;

         
    }
      board[i][j] = char(num + '0');
    
  }
  for (int i = 0; i < H; ++i) cout << board[i] << endl;
  
  return 0;
}
  



Compiler output:
a.cc: In function 'int main()':
a.cc:38:2: error: expected '}' at end of input
   38 | }
      |  ^
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;
  
  string board[50];
  
  for (int i = 0; i < H; ++1) 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];
        
         // out of bounds 防止
         if (ni < 0 or H <= ni ) continue;
         if (nj < 0 or W <= nj ) continue;
         if (board[ni][nj] == '#' ) num++;

         
    }
      board[i][j] = char(num + '0');
    
  }
  for (int i = 0; i < H; ++i) cout << board[i] << endl;
  
  return 0;
}
  



Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: lvalue required as increment operand
   10 |   for (int i = 0; i < H; ++1) cin >> board[i];
      |                            ^
a.cc:38:2: error: expected '}' at end of input
   38 | }
      |  ^
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;
  
  string board[50];
  
  for (int i = 0; i < H; ++1) 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];
        
         // out of bounds 防止
         if (ni < 0 or H <= ni ) continue;
         if (nj < 0 or W <= nj ) continue;
         if (board[ni][nj] == '#' ) num++;

         
    }
      board[i][j] = char(num + '0');
    
  }
  
}
  
  for (int i = 0; i < h; ++i) cout << board[i] << endl;
  
  return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: lvalue required as increment operand
   10 |   for (int i = 0; i < H; ++1) cin >> board[i];
      |                            ^
a.cc:38:23: error: 'h' was not declared in this scope
   38 |   for (int i = 0; i < h; ++i) cout << board[i] << endl;
      |                       ^
a.cc:40:12: error: expected '}' at end of input
   40 |   return 0;
      |            ^
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;
  
  string board[50];
  
  for (int i = 0; i < H; ++1) 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];
        
         // out of bounds 防止
         if (ni < 0 or H <= ni ) continue;
         if (nj < 0 or W <= nj ) continue;
         if (board[ni][nj] == '#' ) num++;

         
    }
      board[i][j] = char(num + '0');
    
  }
  
}
  
  for (int i = 0; i < h; ++i) cout << board[i] << endl;
  
  return 0:


Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: lvalue required as increment operand
   10 |   for (int i = 0; i < H; ++1) cin >> board[i];
      |                            ^
a.cc:38:23: error: 'h' was not declared in this scope
   38 |   for (int i = 0; i < h; ++i) cout << board[i] << endl;
      |                       ^
a.cc:40:11: error: expected ';' before ':' token
   40 |   return 0:
      |           ^
      |           ;
a.cc:40:11: error: expected primary-expression before ':' token
a.cc:40:12: error: expected '}' at end of input
   40 |   return 0:
      |            ^
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;
  string S[50];
  const int dx[8] = {1, 0, 1, -1, 0, -1, 1, -1};
  const int dy[8] = {0, 1, 1, 0, -1, -1, -1, 1};
  
  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] == "#") continue;
      
      int num = 0;
      for(int k=0; k<8; k++){
        int x = i + dx[k];
        int y = j + dy[k];
        if(x < 0 || x >= H) continue;
        if(y < 0 || y >= W) continue;
        if(S[x][y] == '#') num++;
      }
      
      S[i][j] = char(num + '0');
    }
  }
  for(int i=0; i<H; i++) cout << S[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |       if(S[i][j] == "#") continue;
Language: C++

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

string board[60];
int main(void) {
	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 = j + dy[k];
			if (x >= 0 && x < X &&
			    y >= 0 && y < Y &&
			    board[x][y] == '#')
			    cnt ++;
		 }
		 board[i][j] = 'o' + cnt;
      }
    }
  }
  for (int i = 0; i < N; i++) cout << board[i] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: 'dx' was not declared in this scope; did you mean 'x'?
   15 |                         int x = i + dx[k];
      |                                     ^~
      |                                     x
a.cc:16:37: error: 'dy' was not declared in this scope; did you mean 'y'?
   16 |                         int y = j + dy[k];
      |                                     ^~
      |                                     y
a.cc:26:23: error: 'N' was not declared in this scope
   26 |   for (int i = 0; i < N; i++) cout << board[i] << endl;
      |                       ^
Language: C++

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

string board[60]
int main(void) {
	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 = j + dy[k];
			if (x >= 0 && x < X&&
			    y >= 0 && y < Y &&
			    board[x][y] == '#')
			    cnt ++;
		 }
		 board[i][j] = 'o' + cnt;
      }
    }
  }
   for (int i = 0; i < N; i++) cout << boatd[i] << endl;
   return 0;
}

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

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

int main() {
  int m,n,i;
  string str1,str2={};
  cin >> m>>n ;
  for(i=0;i<m;i++){
    cin>>str1;
    str2+=str1;
  }
  for(i=0;i<m*n;i++){
    int flag=0;
    if(str2.at(i)=="."){
      for(int k=-1;k<2;k++){
        for(int l=-1;l<2;l++){
          if(str2.at(i+k*m+l)=="#")flag++;
        }
      }
      char a='0'+flag;
        str2.at(i)=a;
    }
  }
  for(i=0;i<n;i++){
    

  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(str2.at(i)=="."){
      |        ~~~~~~~~~~^~~~~
a.cc:17:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |           if(str2.at(i+k*m+l)=="#")flag++;
      |              ~~~~~~~~~~~~~~~~^~~~~
Language: C++

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

char count(int i){
  int flag=0;
  for(int k=-1;k<2;k++){
        for(int l=-1;l<2;l++){
          if(str2.at(i+k*m+l)=="#")flag++
        }
  }
  char a='0'+flag
  return a;
}

int main() {
  int m,n,i;
  string str1,str2={};
  cin >> m>>n"\n";
  for(i=0;i<m;i++){
    cin>>str1"\n";
    str2+=str1;
  }
  for(i=0;i<m*n;i++){
    if(str2.at(i)=="."){
      str2.at(i)=count(i);
    }
  }
  for(i=0;i<n;i++){
    

  }
}


Compiler output:
a.cc: In function 'char count(int)':
a.cc:8:14: error: 'str2' was not declared in this scope
    8 |           if(str2.at(i+k*m+l)=="#")flag++
      |              ^~~~
a.cc:8:26: error: 'm' was not declared in this scope
    8 |           if(str2.at(i+k*m+l)=="#")flag++
      |                          ^
a.cc:8:42: error: expected ';' before '}' token
    8 |           if(str2.at(i+k*m+l)=="#")flag++
      |                                          ^
      |                                          ;
    9 |         }
      |         ~                                 
a.cc:12:3: error: expected ',' or ';' before 'return'
   12 |   return a;
      |   ^~~~~~
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
a.cc: In function 'int main()':
a.cc:18:14: error: expected ';' before string constant
   18 |   cin >> m>>n"\n";
      |              ^~~~
      |              ;
a.cc:20:14: error: expected ';' before string constant
   20 |     cin>>str1"\n";
      |              ^~~~
      |              ;
a.cc:24:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |     if(str2.at(i)=="."){
      |        ~~~~~~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int H,W;
  vector<int> directionx = {1,0,-1,-1,-1,0,1,1};
  vector<int> directiony = {1,1,1,0,-1,-1,-1,0};
  cin >> H >> W;
  vector<string> blocks(H);
  for(int i = 0; i<H; i++){
    cin >> blocks.at(i);
  }
  
  int num;
  for(int ih = 0; ih<H; ih++){
    for(int iw = 0; iw<W; iw++){
      if(blocks.at(ih).at(iw) == '.'){
       	num = 0;
        for(int i = 0; i<8; i++){
          if(ih + directionx.at(i) < 0 || ih + directionx.at(i) >= H) continue;
          if(iw + directiony.at(i) < 0 || iw + directiony.at(i) >= W) continue;
          if(blocks.at(ih + directionx.at(i)).at(iw + directiony.at(i)) == '#') num++;
        }
        blocks.at(ih).at(iw) = char(num + ’0’);
      }
    }
    cout << blocks.at(ih) << endl;
  }
}

Compiler output:
a.cc:24:43: error: extended character ’ is not valid in an identifier
   24 |         blocks.at(ih).at(iw) = char(num + ’0’);
      |                                           ^
a.cc:24:43: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:24:43: error: '\U000020190\U00002019' was not declared in this scope
   24 |         blocks.at(ih).at(iw) = char(num + ’0’);
      |                                           ^~~