Language: C++

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

int main(){
	str raw_cp[50],raw[52]:
  	int W,H,i,jnt;
  	cin >> H >> W;
  	for(i = 0;i < W+2;i++){
      raw[0].at(i) = '.';
      raw[H+1].at(i) = '.';
    }
  	for(i = 0;i < H;i++)
      cin >> raw_cp[i];
  
  	for(i = 1;i < H+2;i++){
      raw[i] = '.';
      raw[i] += rawcp[i-1];
      raw[i] += '.';
    }
      
  	for(i = 1;i < H+2;i++){
      for(j = 1;j < W+2;j++){
        if(raw[i].at(j-1) == '#')
          count += 1;
        if(raw[i].at(j) == '#')
          count += 1;
        if(raw[i].at(j+1) == '#')
          count += 1;
        if(raw[i-1].at(j-1) == '#')
          count += 1;
        if(raw[i-1].at(j) == '#')
          count += 1;
        if(raw[i-1].at(j+1) == '#')
          count += 1;
        if(raw[i+1].at(j-1) == '#')
          count += 1;
        if(raw[i+1].at(j) == '#')
          count += 1;
        if(raw[i+1].at(j+1) == '#')
          count += 1;
        raw[i].at(j) = count;
        count = 0;
      }
    }
      for(i = 1;i < H+1;i++)
        for(j = 1;j < W;j++)
          raw_cp[i-1].at(j-1) = raw[i].at(j);
          
  for(i = 0;i < H;i++)
    cout << raw_cp[i];
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |         str raw_cp[50],raw[52]:
      |         ^~~
      |         std
a.cc:7:16: error: 'H' was not declared in this scope
    7 |         cin >> H >> W;
      |                ^
a.cc:7:21: error: 'W' was not declared in this scope
    7 |         cin >> H >> W;
      |                     ^
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         for(i = 0;i < W+2;i++){
      |             ^
a.cc:9:7: error: 'raw' was not declared in this scope
    9 |       raw[0].at(i) = '.';
      |       ^~~
a.cc:12:13: error: 'i' was not declared in this scope
   12 |         for(i = 0;i < H;i++)
      |             ^
a.cc:13:14: error: 'raw_cp' was not declared in this scope
   13 |       cin >> raw_cp[i];
      |              ^~~~~~
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         for(i = 1;i < H+2;i++){
      |             ^
a.cc:16:7: error: 'raw' was not declared in this scope
   16 |       raw[i] = '.';
      |       ^~~
a.cc:17:17: error: 'rawcp' was not declared in this scope
   17 |       raw[i] += rawcp[i-1];
      |                 ^~~~~
a.cc:21:13: error: 'i' was not declared in this scope
   21 |         for(i = 1;i < H+2;i++){
      |             ^
a.cc:22:11: error: 'j' was not declared in this scope; did you mean 'jn'?
   22 |       for(j = 1;j < W+2;j++){
      |           ^
      |           jn
a.cc:23:12: error: 'raw' was not declared in this scope
   23 |         if(raw[i].at(j-1) == '#')
      |            ^~~
a.cc:24:20: error: overloaded function with no contextual type information
   24 |           count += 1;
      |                    ^
a.cc:25:12: error: 'raw' was not declared in this scope
   25 |         if(raw[i].at(j) == '#')
      |            ^~~
a.cc:26:20: error: overloaded function with no contextual type information
   26 |           count += 1;
      |                    ^
a.cc:27:12: error: 'raw' was not declared in this scope
   27 |         if(raw[i].at(j+1) == '#')
      |            ^~~
a.cc:28:20: error: overloaded function with no contextual type information
   28 |           count += 1;
      |                    ^
a.cc:29:12: error: 'raw' was not declared in this scope
   29 |         if(raw[i-1].at(j-1) == '#')
      |            ^~~
a.cc:30:20: error: overloaded function with no contextual type information
   30 |           count += 1;
      |                    ^
a.cc:31:12: error: 'raw' was not declared in this scope
   31 |         if(raw[i-1].at(j) == '#')
      |            ^~~
a.cc:32:20: error: overloaded function with no contextual type information
   32 |           count += 1;
      |                    ^
a.cc:33:12: error: 'raw' was not declared in this scope
   33 |         if(raw[i-1].at(j+1) == '#')
      |            ^~~
a.cc:34:20: error: overloaded function with no contextual type information
   34 |           count += 1;
      |                    ^
a.cc:35:12: error: 'raw' was not declared in this scope
   35 |         if(raw[i+1].at(j-1) == '#')
      |            ^~~
a.cc:36:20: error: overloaded function with no contextual type information
   36 |           count += 1;
      |                    ^
a.cc:37:12: error: 'raw' was not declared in this scope
   37 |         if(raw[i+1].at(j) == '#')
      |            ^~~
a.cc:38:20: error: overloaded function with no contextual type information
   38 |           count += 1;
      |                    ^
a.cc:39:12: error: 'raw' was not declared in this scope
   39 |         if(raw[i+1].at(j+1) == '#')
      |            ^~~
a.cc:40:20: error: overloaded function with no contextual type information
   40 |           count += 1;
      |                    ^
a.cc:41:9: error: 'raw' was not declared in this scope
   41 |         raw[i].at(j) = count;
      |         ^~~
a.cc:42:17: error: overloaded function with no contextual type information
   42 |         count = 0;
      |                 ^
a.cc:45:11: error: 'i' was not declared in this scope
   45 |       for(i = 1;i < H+1;i++)
      |           ^
a.cc:46:13: error: 'j' was not declared in this scope; did you mean 'jn'?
   46 |         for(j = 1;j < W;j++)
      |             ^
      |             jn
a.cc:47:11: error: 'raw_cp' was not declared in this scope
   47 |           raw_cp[i-1].at(j-1) = raw[i].at(j);
      |           ^~~~~~
a.cc:47:33: error: 'raw' was not declared in this scope
   47 |           raw_cp[i-1].at(j-1) = raw[i].at(j);
      |                                 ^~~
a.cc:49:7: error: 'i' was not declared in this scope
   49 |   for(i = 0;i < H;i++)
      |       ^
a.cc:50:13: error: 'raw_cp' was not declared in this scope
   50 |     cout << raw_cp[i];
      |             ^~~~~~