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 (i=0; i<H; i++) {
    string S;
    cin >> S;
    for (j=0; j<W; j++) {
      data.at(i).at(j) = S.at(j);
    }
  }
  
  for (i=0; i<H; i++) {
    string str = "";
    for (j=0; j<W; j++) {
      chr c = data.at(i).at(j);
      if (c=='#') {
        str += '#';
      } else { // c=='.'
        int n = 0;
        for (k=0; k<3; k++) {
          for (l=0; l<3; l++) {
            if (l==1) {
              continue;
            }
          　if (i==0) {
              if(k==0) {
                continue;
              }
          　} else if (i==H-1) {
              if(k==2) {
                continue;
              }
          　} else {
             n++;
          　}
          }
        }
          string s;
          sprintf(s,"%d",n);
      　  str += s;
      　}
      cout << str << endl;
    }    
  }
}


Compiler output:
a.cc:30:11: error: extended character 　 is not valid in an identifier
   30 |           　if (i==0) {
      |           ^
a.cc:34:11: error: extended character 　 is not valid in an identifier
   34 |           　} else if (i==H-1) {
      |           ^
a.cc:38:11: error: extended character 　 is not valid in an identifier
   38 |           　} else {
      |           ^
a.cc:40:11: error: extended character 　 is not valid in an identifier
   40 |           　}
      |           ^
a.cc:45:7: error: extended character 　 is not valid in an identifier
   45 |       　  str += s;
      |       ^
a.cc:46:7: error: extended character 　 is not valid in an identifier
   46 |       　}
      |       ^
a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
    9 |   for (i=0; i<H; i++) {
      |        ^
a.cc:12:10: error: 'j' was not declared in this scope
   12 |     for (j=0; j<W; j++) {
      |          ^
a.cc:17:8: error: 'i' was not declared in this scope
   17 |   for (i=0; i<H; i++) {
      |        ^
a.cc:19:10: error: 'j' was not declared in this scope
   19 |     for (j=0; j<W; j++) {
      |          ^
a.cc:20:7: error: 'chr' was not declared in this scope; did you mean 'char'?
   20 |       chr c = data.at(i).at(j);
      |       ^~~
      |       char
a.cc:21:11: error: 'c' was not declared in this scope
   21 |       if (c=='#') {
      |           ^
a.cc:25:14: error: 'k' was not declared in this scope
   25 |         for (k=0; k<3; k++) {
      |              ^
a.cc:26:16: error: 'l' was not declared in this scope
   26 |           for (l=0; l<3; l++) {
      |                ^
a.cc:30:11: error: '\U00003000if' was not declared in this scope
   30 |           　if (i==0) {
      |           ^~~~
a.cc:34:15: error: 'else' without a previous 'if'
   34 |           　} else if (i==H-1) {
      |               ^~~~
a.cc:38:11: error: '\U00003000' was not declared in this scope
   38 |           　} else {
      |           ^~
a.cc:40:11: error: '\U00003000' was not declared in this scope
   40 |           　}
      |           ^~
a.cc:44:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
   44 |           sprintf(s,"%d",n);
      |                   ^
      |                   |
      |                   std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:365:38: note:   initializing argument 1 of 'int sprintf(char*, const char*, ...)'
  365 | extern int sprintf (char *__restrict __s,
      |                     ~~~~~~~~~~~~~~~~~^~~
a.cc:45:7: error: '\U00003000' was not declared in this scope
   45 |       　  str += s;
      |       ^~
a.cc:46:9: error: expected ';' before '}' token
   46 |       　}
      |         ^
      |         ;