Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, w, x, y, z;
  string s, count="........";
  cin >> h >> w;
  y=(w+2)*(h+2)-1;
  for (int i=0, i<y, i++)
    s.at(i)='_';
  
  for (int i=0, i<h, i++) {
    for (int j=0, j<w, j++) {
      x=i+(w+2)*i+1+j;
      cin >> s.at(x);
    }
  }
  
  for (int i=0, i<y, i++) {
    if (s.at(i)=='.') {
      z=0
      count.at(0) = s.at(i-w+1);
      count.at(1) = s.at(i-w+2);
      count.at(2) = s.at(i-w+3);
      count.at(3) = s.at(i-1);
      count.at(4) = s.at(i+1);
      count.at(5) = s.at(i+w+1);
      count.at(6) = s.at(i+w+2);
      count.at(7) = s.at(i+w+3);
      for (int j=0, j<8, j++) {
        if (s.at(j)=='#')
          z++;
      }
      s.(at(i)='z';
    }
  }

  for (int i=0, i<h, i++) {
    for (int j=0, j<w, j++) {
      x=i+(w+2)*i+1+j;
      cout << s.at(x);
    }
    cout << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before '<' token
    8 |   for (int i=0, i<y, i++)
      |                  ^
      |                  ;
a.cc:8:18: error: expected primary-expression before '<' token
a.cc:8:25: error: expected ';' before ')' token
    8 |   for (int i=0, i<y, i++)
      |                         ^
      |                         ;
a.cc:11:18: error: expected ';' before '<' token
   11 |   for (int i=0, i<h, i++) {
      |                  ^
      |                  ;
a.cc:11:18: error: expected primary-expression before '<' token
a.cc:11:25: error: expected ';' before ')' token
   11 |   for (int i=0, i<h, i++) {
      |                         ^
      |                         ;
a.cc:12:20: error: expected ';' before '<' token
   12 |     for (int j=0, j<w, j++) {
      |                    ^
      |                    ;
a.cc:12:20: error: expected primary-expression before '<' token
a.cc:12:27: error: expected ';' before ')' token
   12 |     for (int j=0, j<w, j++) {
      |                           ^
      |                           ;
a.cc:18:18: error: expected ';' before '<' token
   18 |   for (int i=0, i<y, i++) {
      |                  ^
      |                  ;
a.cc:18:18: error: expected primary-expression before '<' token
a.cc:18:25: error: expected ';' before ')' token
   18 |   for (int i=0, i<y, i++) {
      |                         ^
      |                         ;
a.cc:20:10: error: expected ';' before 'count'
   20 |       z=0
      |          ^
      |          ;
   21 |       count.at(0) = s.at(i-w+1);
      |       ~~~~~
a.cc:29:22: error: expected ';' before '<' token
   29 |       for (int j=0, j<8, j++) {
      |                      ^
      |                      ;
a.cc:29:22: error: expected primary-expression before '<' token
a.cc:29:29: error: expected ';' before ')' token
   29 |       for (int j=0, j<8, j++) {
      |                             ^
      |                             ;
a.cc:33:9: error: expected unqualified-id before '(' token
   33 |       s.(at(i)='z';
      |         ^
a.cc:33:10: error: 'at' was not declared in this scope
   33 |       s.(at(i)='z';
      |          ^~
a.cc:37:18: error: expected ';' before '<' token
   37 |   for (int i=0, i<h, i++) {
      |                  ^
      |                  ;
a.cc:37:18: error: expected primary-expression before '<' token
a.cc:37:25: error: expected ';' before ')' token
   37 |   for (int i=0, i<h, i++) {
      |                         ^
      |                         ;
a.cc:38:20: error: expected ';' before '<' token
   38 |     for (int j=0, j<w, j++) {
      |                    ^
      |                    ;
a.cc:38:20: error: expected primary-expression before '<' token
a.cc:38:27: error: expected ';' before ')' token
   38 |     for (int j=0, j<w, j++) {
      |                           ^
      |                           ;