Language: C++

#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
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<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:34:21: error: extended character ’ is not valid in an identifier
   34 |  if (board[i][j] == ’#’) continue;
      |                     ^
a.cc:34:22: error: stray '#' in program
   34 |  if (board[i][j] == ’#’) continue;
      |                      ^
a.cc:34:23: error: extended character ’ is not valid in an identifier
   34 |  if (board[i][j] == ’#’) continue;
      |                       ^
a.cc:43:23: error: extended character ’ is not valid in an identifier
   43 |  if (board[ni][nj] == ’#’) num++;
      |                       ^
a.cc:43:24: error: stray '#' in program
   43 |  if (board[ni][nj] == ’#’) num++;
      |                        ^
a.cc:43:25: error: extended character ’ is not valid in an identifier
   43 |  if (board[ni][nj] == ’#’) num++;
      |                         ^
a.cc:46:27: error: extended character ’ is not valid in an identifier
   46 |  board[i][j] = char(num + ’0’);
      |                           ^
a.cc:46:27: error: extended character ’ is not valid in an identifier
a.cc:13:10: error: 'vector' does not name a type
   13 | using vl=vector<ll>;
      |          ^~~~~~
a.cc:14:11: error: 'vector' does not name a type
   14 | using vvl=vector<vector<ll>>;
      |           ^~~~~~
a.cc: In function 'int main()':
a.cc:24:3: error: 'cin' was not declared in this scope
   24 |   cin >> h >> w;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <math.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:26:2: error: 'string' was not declared in this scope
   26 |  string board[50];
      |  ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include <math.h>
  +++ |+#include <string>
    2 | using namespace std;
a.cc:28:37: error: 'board' was not declared in this scope
   28 |  for (int i = 0; i < h; ++i) cin >> board[i];
      |                                     ^~~~~
a.cc:34:6: error: 'board' was not declared in this scope
   34 |  if (board[i][j] == ’#’) continue;
      |      ^~~~~
a.cc:34:21: error: '\U00002019' was not declared in this scope
   34 |  if (board[i][j] == ’#’) continue;
      |                     ^
a.cc:34:22: error: expected ')' before '\U00002019'
   34 |  if (board[i][j] == ’#’) continue;
      |     ~                ^~
      |                      )
a.cc:41:8: error: unable to find numeric literal operator 'operator""orh'
   41 |  if(ni<0orh<=ni)continue;
      |        ^~~~
a.cc:42:8: error: unable to find numeric literal operator 'operator""orw'
   42 |  if(nj<0orw<=nj)continue;
      |        ^~~~
a.cc:43:6: error: 'board' was not declared in this scope
   43 |  if (board[ni][nj] == ’#’) num++;
      |      ^~~~~
a.cc:43:23: error: '\U00002019' was not declared in this scope
   43 |  if (board[ni][nj] == ’#’) num++;
      |                       ^
a.cc:43:24: error: expected ')' before '\U00002019'
   43 |  if (board[ni][nj] == ’#’) num++;
      |     ~                  ^~
      |                        )
a.cc:46:2: error: 'board' was not declared in this scope
   46 |  board[i][j] = char(num + ’0’);
      |  ^~~~~
a.cc:46:27: error: '\U000020190\U00002019' was not declared in this scope
   46 |  board[i][j] = char(num + ’0’);
      |                           ^~~
a.cc:50:30: error: 'cout' was not declared in this scope
   50 |  for (int i = 0; i < h; ++i) cout << board[i] << endl;
      |                              ^~~~
a.cc:50:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:50:38: error: 'board' was not declared in this scope
   50 |  for (int i = 0; i < h; ++i) cout << board[i] << endl;
      |                                      ^~~~~
a.cc:50:50: error: 'endl' was not declared in this scope
   50 |  for (int i = 0; i < h; ++i) cout << board[i] << endl;
      |                                                  ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <math.h>
  +++ |+#include <ostream>
    2 | using namespace std;