criyle/codenet-compile-errors huggingface dataset:
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(i)).at(iw + directiony(i)) == '#') num++;
        }
        blocks.at(ih).at(iw) = num;
      }
    }
    cout << blocks.at(ih) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:39: error: no match for call to '(std::vector<int>) (int&)'
   22 |           if(blocks.at(ih + directionx(i)).at(iw + directiony(i)) == '#') num++;
      |                             ~~~~~~~~~~^~~
a.cc:22:62: error: no match for call to '(std::vector<int>) (int&)'
   22 |           if(blocks.at(ih + directionx(i)).at(iw + directiony(i)) == '#') num++;
      |                                                    ~~~~~~~~~~^~~
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(i) < 0 || ih + directionx(i) >= H) continue;
          if(iw + directiony(i) < 0 || iw + directiony(i) >= W) continue;
          if(blocks.at(ih + directionx(i)).at(iw + directiony(i)) == '#') num++;
        }
        blocks.at(ih).at(iw) = num;
      }
    }
    cout << blocks.at(ih) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: no match for call to '(std::vector<int>) (int&)'
   20 |           if(ih + directionx(i) < 0 || ih + directionx(i) >= H) continue;
      |                   ~~~~~~~~~~^~~
a.cc:20:55: error: no match for call to '(std::vector<int>) (int&)'
   20 |           if(ih + directionx(i) < 0 || ih + directionx(i) >= H) continue;
      |                                             ~~~~~~~~~~^~~
a.cc:21:29: error: no match for call to '(std::vector<int>) (int&)'
   21 |           if(iw + directiony(i) < 0 || iw + directiony(i) >= W) continue;
      |                   ~~~~~~~~~~^~~
a.cc:21:55: error: no match for call to '(std::vector<int>) (int&)'
   21 |           if(iw + directiony(i) < 0 || iw + directiony(i) >= W) continue;
      |                                             ~~~~~~~~~~^~~
a.cc:22:39: error: no match for call to '(std::vector<int>) (int&)'
   22 |           if(blocks.at(ih + directionx(i)).at(iw + directiony(i)) == '#') num++;
      |                             ~~~~~~~~~~^~~
a.cc:22:62: error: no match for call to '(std::vector<int>) (int&)'
   22 |           if(blocks.at(ih + directionx(i)).at(iw + directiony(i)) == '#') num++;
      |                                                    ~~~~~~~~~~^~~
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(i) < 0 || ih + directionx(i) >= H) continue;
          if(iw + directiony(i) < 0 || iw + directiony(i) >= W) continue;
          if(blocks.at(ih + directionx(i)).at(iw + directiony(i)) == '#') num++;
        }
        blocks.at(ih).at(iw) = num;
      }
    }
    cout << blocks.at(ih) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '<' token
   10 |   for(int i = 0, i<H; i++){
      |                   ^
      |                   ;
a.cc:10:19: error: expected primary-expression before '<' token
a.cc:20:29: error: no match for call to '(std::vector<int>) (int&)'
   20 |           if(ih + directionx(i) < 0 || ih + directionx(i) >= H) continue;
      |                   ~~~~~~~~~~^~~
a.cc:20:55: error: no match for call to '(std::vector<int>) (int&)'
   20 |           if(ih + directionx(i) < 0 || ih + directionx(i) >= H) continue;
      |                                             ~~~~~~~~~~^~~
a.cc:21:29: error: no match for call to '(std::vector<int>) (int&)'
   21 |           if(iw + directiony(i) < 0 || iw + directiony(i) >= W) continue;
      |                   ~~~~~~~~~~^~~
a.cc:21:55: error: no match for call to '(std::vector<int>) (int&)'
   21 |           if(iw + directiony(i) < 0 || iw + directiony(i) >= W) continue;
      |                                             ~~~~~~~~~~^~~
a.cc:22:39: error: no match for call to '(std::vector<int>) (int&)'
   22 |           if(blocks.at(ih + directionx(i)).at(iw + directiony(i)) == '#') num++;
      |                             ~~~~~~~~~~^~~
a.cc:22:62: error: no match for call to '(std::vector<int>) (int&)'
   22 |           if(blocks.at(ih + directionx(i)).at(iw + directiony(i)) == '#') num++;
      |                                                    ~~~~~~~~~~^~~
Language: C++

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

int main(){
  int H,W;
  vector<int> directionx(8){1,0,-1,-1,-1,0,1,1};
  vector<int> directiony(8){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(i) < 0 || ih + directionx(i) >= H) continue;
          if(iw + directiony(i) < 0 || iw + directiony(i) >= W) continue;
          if(blocks.at(ih + directionx(i)).at(iw + directiony(i)) == '#') num++;
        }
        blocks.at(ih).at(iw) = num;
      }
    }
    cout << blocks.at(ih) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:28: error: expected ',' or ';' before '{' token
    6 |   vector<int> directionx(8){1,0,-1,-1,-1,0,1,1};
      |                            ^
a.cc:7:28: error: expected ',' or ';' before '{' token
    7 |   vector<int> directiony(8){1,1,1,0,-1,-1,-1,0};
      |                            ^
a.cc:10:19: error: expected ';' before '<' token
   10 |   for(int i = 0, i<H; i++){
      |                   ^
      |                   ;
a.cc:10:19: error: expected primary-expression before '<' token
a.cc:20:29: error: no match for call to '(std::vector<int>) (int&)'
   20 |           if(ih + directionx(i) < 0 || ih + directionx(i) >= H) continue;
      |                   ~~~~~~~~~~^~~
a.cc:20:55: error: no match for call to '(std::vector<int>) (int&)'
   20 |           if(ih + directionx(i) < 0 || ih + directionx(i) >= H) continue;
      |                                             ~~~~~~~~~~^~~
a.cc:21:29: error: no match for call to '(std::vector<int>) (int&)'
   21 |           if(iw + directiony(i) < 0 || iw + directiony(i) >= W) continue;
      |                   ~~~~~~~~~~^~~
a.cc:21:55: error: no match for call to '(std::vector<int>) (int&)'
   21 |           if(iw + directiony(i) < 0 || iw + directiony(i) >= W) continue;
      |                                             ~~~~~~~~~~^~~
a.cc:22:39: error: no match for call to '(std::vector<int>) (int&)'
   22 |           if(blocks.at(ih + directionx(i)).at(iw + directiony(i)) == '#') num++;
      |                             ~~~~~~~~~~^~~
a.cc:22:62: error: no match for call to '(std::vector<int>) (int&)'
   22 |           if(blocks.at(ih + directionx(i)).at(iw + directiony(i)) == '#') num++;
      |                                                    ~~~~~~~~~~^~~
Language: C++

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

int main(){
  int H,W;
  vector<int> direction(8)(2){{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{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 + direction(i)(0) < 0 || ih + direction(i)(0) >= H) continue;
          if(iw + direction(i)(1) < 0 || iw + direction(i)(1) >= W) continue;
          if(blocks.at(ih + direction(i)(0)).at(iw + direction(i)(1)) == '#') num++;
        }
        blocks.at(ih).at(iw) = num;
      }
    }
    cout << blocks.at(ih) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:27: error: expected ',' or ';' before '(' token
    6 |   vector<int> direction(8)(2){{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1},{1,0}};
      |                           ^
a.cc:9:19: error: expected ';' before '<' token
    9 |   for(int i = 0, i<H; i++){
      |                   ^
      |                   ;
a.cc:9:19: error: expected primary-expression before '<' token
a.cc:19:28: error: no match for call to '(std::vector<int>) (int&)'
   19 |           if(ih + direction(i)(0) < 0 || ih + direction(i)(0) >= H) continue;
      |                   ~~~~~~~~~^~~
a.cc:19:56: error: no match for call to '(std::vector<int>) (int&)'
   19 |           if(ih + direction(i)(0) < 0 || ih + direction(i)(0) >= H) continue;
      |                                               ~~~~~~~~~^~~
a.cc:20:28: error: no match for call to '(std::vector<int>) (int&)'
   20 |           if(iw + direction(i)(1) < 0 || iw + direction(i)(1) >= W) continue;
      |                   ~~~~~~~~~^~~
a.cc:20:56: error: no match for call to '(std::vector<int>) (int&)'
   20 |           if(iw + direction(i)(1) < 0 || iw + direction(i)(1) >= W) continue;
      |                                               ~~~~~~~~~^~~
a.cc:21:38: error: no match for call to '(std::vector<int>) (int&)'
   21 |           if(blocks.at(ih + direction(i)(0)).at(iw + direction(i)(1)) == '#') num++;
      |                             ~~~~~~~~~^~~
a.cc:21:63: error: no match for call to '(std::vector<int>) (int&)'
   21 |           if(blocks.at(ih + direction(i)(0)).at(iw + direction(i)(1)) == '#') num++;
      |                                                      ~~~~~~~~~^~~
Language: C++

#include<iostream>
using namespace std;
char a[51][51];
int b[51][51];
int n,m;
int main(){
	cin>>n>>m;
	memset(b,0,sizeof(b));
	for(int i=1;i<=n;i++)
	for(int j=1;j<=m;j++)
	cin>>a[i][j];
	for(int i=1;i<=n;i++)
	for(int j=1;j<=m;j++)
	{
		if(a[i][j]=='.')
		{
			if(a[i+1][j]=='#')
			b[i][j]++;
			if(a[i-1][j]=='#')
			b[i][j]++;
			if(a[i][j+1]=='#')
			b[i][j]++;
			if(a[i][j-1]=='#')
			b[i][j]++;
			if(a[i+1][j+1]=='#')
			b[i][j]++;
			if(a[i+1][j-1]=='#')
			b[i][j]++;
			if(a[i-1][j+1]=='#')
			b[i][j]++;
			if(a[i-1][j-1]=='#')
			b[i][j]++;
		}
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
	{
		if(a[i][j]=='#')
		cout<<a[i][j];
		else
		cout<<b[i][j];
	}
	cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'memset' was not declared in this scope
    8 |         memset(b,0,sizeof(b));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

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

int main(){

  int i,j;

  int H;
  int W;
  string S[60];

  cin >> H >> W;

  REP(i,H){
    cin >> S[i];
  }

  auto get_bomb = [&](int i, int j){
    int count = 0;
    for (int k = i-1; k <= i+1 ; k++) {
      for (int l = j-1; l < j+1; l++) {
        if (k < 0 || k >= W) {
          continue;
        }
        if (l < 0 || l >= W) {
          continue;
        }
        if (S[k][l] == '#') {
          count++;
        }
      }
    }
    return count;
  }

  rep(i,H){
    rep(j,W){
      if(S[i][j] = '#'){
        S[i][j] = get_bomb(i,j);
      }else{
        continue;
      }
    }
  }

  REP(i,H){
    cout << S[i] << endl;
  }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:18: error: expected ',' or ';' before 'for'
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                  ^~~
a.cc:39:3: note: in expansion of macro 'rep'
   39 |   rep(i,H){
      |   ^~~
a.cc:3:37: error: expected ';' before ')' token
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                     ^
a.cc:39:3: note: in expansion of macro 'rep'
   39 |   rep(i,H){
      |   ^~~
Language: C++

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




int main(){

  int i,j;

  int H;
  int W;
  string S[60];

  cin >> H >> W;

  REP(i,H){
    cin >> S[i];
  }

  auto get_bomb = [&](int i, int j){
    int count = 0;
    for (int k = i-1; k <= i+1 ; k++) {
      for (int l = j-1; l < j+1; l++) {
        if (k < 0 || k >= W) {
          continue;
        }
        if (l < 0 || l >= W) {
          continue;
        }
        if (S[k][l] == '#') {
          count++;
        }
      }
    }
    return count;
  }

  rep(i,H){
    rep(j,W){
      if(S[i][j] = '#'){
        S[i][j] = get_bomb(i,j);
      }else{
        continue;
      }
    }
  }

  REP(i,H){
    cout << S[i] << endl;
  }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:18: error: expected ',' or ';' before 'for'
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                  ^~~
a.cc:42:3: note: in expansion of macro 'rep'
   42 |   rep(i,H){
      |   ^~~
a.cc:3:37: error: expected ';' before ')' token
    3 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                     ^
a.cc:42:3: note: in expansion of macro 'rep'
   42 |   rep(i,H){
      |   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef long long ll;
 
int main(){
    int h,w;cin>>h>>w;
    vector<string> s(h);
    rep(i,h) cin>>s[i];
    /////////
    rep(i,h){
        rep(j,w){
            if(s[i][j]!='#'){
                int count=0;
                for(int k=i-1;k<=i+1;++k){
                    for(int l=j-1;l<=l+1;++l){
                        if(k<0 || k>=h)continue;
                        if(l<0 || l>=w)continue;
                        if(s[k][l]=='#')count+=1;          
                    }
                }
            s[i][j]=char(count+'0')
            }
            }
        }
rep(i,h) cout<<s[i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:36: error: expected ';' before '}' token
   22 |             s[i][j]=char(count+'0')
      |                                    ^
      |                                    ;
   23 |             }
      |             ~
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 (int i=0; i<H; i++) {
    string S;
    cin >> S;
    for (int 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++) {
      char c = data.at(i).at(j);
      if (c=='#') {
        str += '#';
      } else { // c=='.'
        int n = 0;
        for (int k=0; k<3; k++) {
          for (l=0; l<3; l++) {
            if (int 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: In function 'int main()':
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:26:16: error: 'l' was not declared in this scope
   26 |           for (l=0; l<3; l++) {
      |                ^
a.cc:27:22: error: expected initializer before '==' token
   27 |             if (int l==1) {
      |                      ^~
a.cc:27:22: error: expected ')' before '==' token
   27 |             if (int l==1) {
      |                ~     ^~
      |                      )
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,
      |                     ~~~~~~~~~~~~~~~~~^~~
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: 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: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,
      |                     ~~~~~~~~~~~~~~~~~^~~
Language: C++

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

int main() {
  int H, W;
  cin >> H, W;

   //0行目 S_above
  string S_above = "..";
  for (int i = 0; i < W; i++)
    S_above += '.';
  
   //H+1行目にもコピー
  string S_H_below = S_above;

  //1～H行目
  string S, S_below;
  cin >> S;
  S = '.' + S + '.';
  for (int i = 1; i < H; i++) {    //　iは行番号 最下行は別に処理
    cin >> S_below;
    S_below = '.' + S_below + '.';
    for (int j = 1; j < W+1; j++) { //　行の処理　jは文字番号
      int k = 0; // kは#の数
      if (S.at(j) == '#')
        cout << '#';
      else {
        if (S_above.at(j-1) == '#')
          k+=1;
        if (S_above.at(j) == '#')
          k+=1;
        if (S_above.at(j+1) == '#')
          k+=1;
        if (S.at(j-1) =='#')
          k+=1;
        if (S.at(j+1) =='#')
          k+=1;
        if (S_below.at(j-1) =='#')
          k+=1;
        if (S_below.at(j) =='#')
          k+=1;
        if (S_below.at(j+1) =='#')
          k+=1;
      cout << k;
      }
    }                 // 各行ごとの処理おわり
    cout << endl;
    S_abobe = S;
    S = S_below;
  }
  cout << endl;
   // H-1行目まで処理おわり
  
   // H行目の処理
  S_below = S_H_below;
  for (int j = 1; j < W+1; j++) { //　jは文字番号
  int k = 0; // kは#の数
    if (S.at(j) == '.') {
      if (S_above.at(j-1) == '#')
        k+=1;
      if (S_above.at(j) == '#')
        k+=1;
      if (S_above.at(j+1) == '#')
        k+=1;
      if (S.at(j-1) =='#')
        k+=1;
      if (S.at(j+1) =='#')
        k+=1;
      if (S_below.at(j-1) =='#')
        k+=1;
      if (S_below.at(j) =='#')
        k+=1;
      if (S_below.at(j+1) =='#')
        k+=1;
      cout << k;
    }
    else
      cout << '#';
  }
  cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:5: error: 'S_abobe' was not declared in this scope; did you mean 'S_above'?
   48 |     S_abobe = S;
      |     ^~~~~~~
      |     S_above
Language: C++

int main() {

	int H, W;
	cin >> H >> W;

	string S[50];

	for (int i = 0; i < H; i++) {
		cin >> S[i];
	}

	const int dx[8] = {-1, -1, -1,  0, 0,  1, 1, 1};
	const int dy[8] = {-1,  0,  1, -1, 1, -1, 0, 1};

	rep(i, H) {
		rep(j, W) {
			if (S[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 < 0 || H <= ni) continue;
				if (nj < 0 || W	<= nj) continue;
				if (S[ni][nj] == '#') num++;
			}

			S[i][j] = char(num + '0');
		}	
	}

	rep(i, H) {
		cout << S[i] << endl;	
	}	

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> H >> W;
      |         ^~~
a.cc:6:9: error: 'string' was not declared in this scope
    6 |         string S[50];
      |         ^~~~~~
a.cc:9:24: error: 'S' was not declared in this scope
    9 |                 cin >> S[i];
      |                        ^
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         rep(i, H) {
      |             ^
a.cc:15:9: error: 'rep' was not declared in this scope
   15 |         rep(i, H) {
      |         ^~~
Language: C++

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


int main() {
  vector<string> H;
  int W
  cin >> H.size() >> W ;
  

}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected initializer before 'cin'
    9 |   cin >> H.size() >> W ;
      |   ^~~
Language: C++

#include<bits/stdc++.h>

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);


    int h, w, c;
    char a[55][55];

	cin >> h >> w;
	for(int i = 1; i <= h; i++) cin >> a[i][1];
	for(int i = 1; i <= h; i++, puts(""))
        for(int j = 1; j <= w; j++){
		    if(a[i][j] == '#'){
                putchar('#');
                continue;
            }
		c = 48;
		for(int x = i-1; x <= i+1; x++)
            for(int y = j - 1; y <= j + 1; y++)
                c += (a[x][y]=='#');
		putchar(c);
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     cin.tie(0);
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:5: error: 'ios' has not been declared
    5 |     ios::sync_with_stdio(false);
      |     ^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int H, W;
  cin >> H >> W;
  char moji[H][W];  // 入力領域の配列（H行W列)
  char mine[H][W];  // 出力領域の配列（H行W列)

  // 出力領域の配列の初期化
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      mine[i][j] = '0';
    }
  }

  // 文字列入力
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      cin >> moji[i][j];
    }
  }

  // 地雷だったら、周囲のマスの地雷の数をインクリメントする
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      // 地雷だったら
      if(moji[i][j] == '#'){
        // 周囲のマスの地雷の数をインクリメントする
        for(int k = i - 1; k <= i + 1; k++){
          if(k >= 0 && k < H){　// y軸が範囲内なら
            for(int l = j - 1; l <= j + 1; l++){
              if(l >= 0 && l < W){   // x軸が範囲内なら
                if(moji[k][l] == '.'){  // 周囲のマスが'.'なら
                  mine[k][l]++;         // mineの地雷の数をインクリメント
                }else{
                   mine[k][l] = '#';    // 周囲のマスが'#'ならmineに'#'を代入
                }
              }
            }
          }
        }
      }
    }
  }

  // 出力 
 for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      cout << mine[i][j];
    }
    cout << endl;
  }
}

Compiler output:
a.cc:31:31: error: extended character 　 is not valid in an identifier
   31 |           if(k >= 0 && k < H){　// y軸が範囲内なら
      |                               ^
a.cc: In function 'int main()':
a.cc:31:31: error: '\U00003000' was not declared in this scope
   31 |           if(k >= 0 && k < H){　// y軸が範囲内なら
      |                               ^~
a.cc:32:32: error: 'l' was not declared in this scope
   32 |             for(int l = j - 1; l <= j + 1; l++){
      |                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  vector<string>s(51);
  vector<int>x(8)={1,1,1,0,0,-1,-1,-1};
  vector<int>y(8)={1,0,-1,1,-1,1,0,-1};
  cin >> h >> w;
  for(int i=0;i<h;i++)cin >> s.at(i);
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      int ni,nj,ans;
      if(s[i][j]=='#')continue;
      for(int k=0;k<8;k++){
        ni=i+x[k];nj=j+y[k];
        if(ni<0||h<=ni)continue;
        if(nj<0||w<=nj)continue;
        if(s[ni][nj]=='#')ans++;
      }
      s[i][j]=char(ans);
    }
    cout << s[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: expected ',' or ';' before '=' token
    6 |   vector<int>x(8)={1,1,1,0,0,-1,-1,-1};
      |                  ^
a.cc:7:18: error: expected ',' or ';' before '=' token
    7 |   vector<int>y(8)={1,0,-1,1,-1,1,0,-1};
      |                  ^
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()


ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b){
  ll r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return b;
}


ll LCM(ll a,ll b){
  ll c=a,d=b,r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return c/b*d;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

vector<pair<char,ll>> runlength(string s,vector<pair<char,ll>> p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
    return p;
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
  return p;
}


string board[50];
ll dx[]={-1,-1,-1,1,1,1,0,0};
ll dy[]={-1,0,1,-1,0,1,-1,1};

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  ios::sync_with_stdio(false);
  ll X,Y;
  cin>>X>>Y;
  rep(i,n) cin>>board[i];
  rep(i,X){
    rep(j,Y){
      if(board[i][j]=='.'){
        ll cnt=0;
        rep(k,8){
          ll x=i+dx[k];
          ll y=j+dy[k];
          if(0<=x && x<X && 0<=y && y<Y && board[x][y]=='#') cnt++;
        }
        board[i][j]='0'+cnt;
      }
    }
  }
  rep(i,X){
    cout<<board[i]<<endl;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:101:9: error: 'n' was not declared in this scope
  101 |   rep(i,n) cin>>board[i];
      |         ^
a.cc:6:38: note: in definition of macro 'rep'
    6 | #define rep(i, n) for(ll i = 0; i < (n); i++)
      |                                      ^
Language: C++

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

int main(){
  int h, w;
  cin >> h >> w;
  
  vector<string> board(50);
  for (int = i;i<h;++i) cin >> board.at(i);
  
  const vector<int> dx = {1,0,-1,0,1,1,-1,-1}
  const vector<int> dy = {0,1,0,-1,1,-1,1,-1}
  
  for (int = i;i<h;++i){
      for (int = j;j<w;++j){
      	if (board.at(i).at(j) == '#') continue;
        
        int n=0;
        for (int k=0;k<8;++k){
          const int ni = i + dy.at(k);
          const int nj = j + dx.at(k);
          if (ni < 0 || h < ni) continue;
          if (nj < 0 || w < nj) continue;
          
          if (board.at(ni).at(nj) == '#') n++;
        }
        
        board.at(i).at(j) = char(n+'0');
      }
  }
  for (int i = 0 ; i < h ; ++i) cout << board.at(i) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected unqualified-id before '=' token
    9 |   for (int = i;i<h;++i) cin >> board.at(i);
      |            ^
a.cc:9:11: error: expected ';' before '=' token
    9 |   for (int = i;i<h;++i) cin >> board.at(i);
      |           ^~
      |           ;
a.cc:9:12: error: expected primary-expression before '=' token
    9 |   for (int = i;i<h;++i) cin >> board.at(i);
      |            ^
a.cc:9:14: error: 'i' was not declared in this scope
    9 |   for (int = i;i<h;++i) cin >> board.at(i);
      |              ^
a.cc:9:19: error: expected ')' before ';' token
    9 |   for (int = i;i<h;++i) cin >> board.at(i);
      |       ~           ^
      |                   )
a.cc:9:22: error: 'i' was not declared in this scope
    9 |   for (int = i;i<h;++i) cin >> board.at(i);
      |                      ^
a.cc:12:3: error: expected ',' or ';' before 'const'
   12 |   const vector<int> dy = {0,1,0,-1,1,-1,1,-1}
      |   ^~~~~
a.cc:14:12: error: expected unqualified-id before '=' token
   14 |   for (int = i;i<h;++i){
      |            ^
a.cc:14:11: error: expected ';' before '=' token
   14 |   for (int = i;i<h;++i){
      |           ^~
      |           ;
a.cc:14:12: error: expected primary-expression before '=' token
   14 |   for (int = i;i<h;++i){
      |            ^
a.cc:14:19: error: expected ')' before ';' token
   14 |   for (int = i;i<h;++i){
      |       ~           ^
      |                   )
Language: C++

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

int main(){
  int h,w,count=0;
  string s;
  cin>>h>>w;
  vector<string> vec(h+2,"");
  for(int i=0;i<w+2;i++){
    vec.at(0)+=".";
    vec.at(h+1)+=".";
  }
  for(int i=1;i<h+1;i++){
    cin>>vec.at(i);
    vec.at(i)='.'+vec.at(i)+'.';
  }
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++){
      count=0;
      if(vec.at(i).at(j)=='.'){
          for(int i=-1;i<2;i++){
            for(int j=-1;j<2;j++){
              if(vec.at(i).at(j)=='#'){
                count+=1;
              }
            }
          }
        cout<<count;
      }else{
        cout<<vec.at(i).at(j);
    }
      cout<<endl;
  }
}
          
   


Compiler output:
a.cc: In function 'int main()':
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
  int h,w,count=0;
  string s;
  cin>>h>>w;
  vector<string> vec(h+2,"");
  for(int i=0;i<w+2;i++){
    vec.at(0)+=".";
    vec.at(h+1)+=".";
  }
  for(int i=1;i<h+1;i++){
    cin>>vec.at(i);
  }
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++){
      if((vec.at(i)).at(j)=='.'){
          for(int i=-1;i<2;i++){
            for(int j=-1;j<2;j++){
              if((vec.at(i)).at(j)=='#'){
                count+=1;
              }
            }
          }
        (vec.at(i)).at(j)=count;
      }
    }
  }
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++){
      cout<<vec(i).at(j);
    }
    cout<<endl;
  }
}
          
   


Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   32 |       cout<<vec(i).at(j);
      |             ~~~^~~
Language: C++

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

int main(){
  int h,w,count=0;
  string s;
  cin>>h>>w;
  vector<string> vec(h+2,"");
  for(int i=0;i<w+2;i++){
    vec.at(0)+=".";
    vec.at(h+1)+=".";
  }
  for(int i=1;i<h;1;i++){
    cin>>vec.at(i);
  }
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++){
      if((vec.at(i)).at(j)=='.'){
          for(int i=-1;i<2;i++){
            for(int j=-1;j<2;j++){
              if((vec.at(i)).at(j)=='#'){
                count+=1;
              }
            }
          }
        (vec.at(i)).at(j)=count;
      }
    }
  }
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++){
      cout<<vec(i).at(j);
    }
    cout<<endl;
  }
}
          
   

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: expected ')' before ';' token
   13 |   for(int i=1;i<h;1;i++){
      |      ~             ^
      |                    )
a.cc:13:21: error: 'i' was not declared in this scope
   13 |   for(int i=1;i<h;1;i++){
      |                     ^
a.cc:32:16: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   32 |       cout<<vec(i).at(j);
      |             ~~~^~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define divceil(A, B) ((A + (B - 1)) / B)
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()
#define CERR if(false) cerr

using namespace std;

int main(){

    int h,w;
    cin >> h >> w;

    vector<string> s;

    rep(i,h){
        string tmps
        cin >> tmps;
        s.pback(tmps);
    }

    rep(i,h){
        rep(j,w){
            if(s[i][j] == '#') continue;
            int count = 0;
            
            rep(k,8){
                int x = j + round(cos(0.25 * PI * k));
                int y = i + round(sin(0.25 * PI * k));

                if(0 <= x && x <= w - 1 && 0 <= y && y <= h - 1){
                    if(s[y][x] == '#') count++;
                }
            }
            s[i][j] = count;
        }

        cout << s[i] << endl;
    }
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: expected initializer before 'cin'
   23 |         cin >> tmps;
      |         ^~~
a.cc:24:17: error: 'tmps' was not declared in this scope; did you mean 'tm'?
   24 |         s.pback(tmps);
      |                 ^~~~
      |                 tm
Language: C++

H,W=map(int,input().split())
S=[[0 for i in range(W)] for j in range(H)]
for i in range(H):
  a=list(map(str,input()))
  for j in range(W):
    S[i][j]=a[j]
  a=[]
#print(S)
V=[[0 for i in range(W)] for j in range(H)]
for m in range(H):
  for n in range(W):
    if S[m][n]=="#":
      V[m][n]="#"
      continue
      
    if m > 0 and n > 0 and S[m-1][n-1]=="#":
      V[m][n] += 1
    if m > 0 and S[m-1][n]=="#":
      V[m][n] += 1
    if m > 0 and n < W - 1 and S[m-1][n+1]=="#":
      V[m][n] += 1
    if n > 0 and S[m][n-1]=="#":
      V[m][n] += 1
    if n < W - 1 and S[m][n+1]=="#":
      V[m][n] += 1
    if m < H - 1 and n > 0 and S[m+1][n-1]=="#":
      V[m][n] += 1
    if m < H - 1 and S[m+1][n]=="#":
      V[m][n] += 1
    if m < H - 1 and n < W - 1 and S[m+1][n+1]=="#":
      V[m][n] += 1

a=[]
#print(V)
for k in range(H):
  for l in range(W):
    a.append(V[k][l])
  print("".join(map(str,a)))
  a=[]

Compiler output:
a.cc:8:2: error: invalid preprocessing directive #print
    8 | #print(S)
      |  ^~~~~
a.cc:34:2: error: invalid preprocessing directive #print
   34 | #print(V)
      |  ^~~~~
a.cc:1:1: error: 'H' does not name a type
    1 | H,W=map(int,input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; };
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; };

int dx[8] = { 1,1,1,0,0,-1,-1,-1 };
int dy[8] = { 1,0,-1,1,-1,1,0,-1 };
string board[60];

int main() {
	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 < Y;++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] = '0' + cnt;
			}
		}
	}
	for (int i = 0;i < x;++i)cout << board[i] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:28: error: 'x' was not declared in this scope
   33 |         for (int i = 0;i < x;++i)cout << board[i] << endl;
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int h,w;
  cin>>h>>w;
  vector<string> str(50);
  for(int i=0;i<h;++i) cin>>str(i);
  vector<int> x={1,1,1,0,0,-1,-1,-1};
  vector<int> y={1,0,-1,1,-1,1,0,-1};
  for(int i=0;i<h;++i){
    for(int j=0;j<w;++j){
      if(str[i][j]=='#')continue;
      for(int k=0;k<8;++k){
        int ni=i+x[k];
        int nj=j+y[k];
        int num=0;
        if(ni<0||ni>=h)continue;
        if(nj<0||nj>=w)continue;
        if(str[ni][nj]=='#')++num;
        str[i][j]=num+'0';  
    }
      cout<<str[i]<<endl;
  }  
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:32: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
    8 |   for(int i=0;i<h;++i) cin>>str(i);
      |                             ~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int h,w;
  cin>>h>>w;
  vector<string> str(50);
  for(int i=0;i<h;++i) cin>>str(i);
  vector<int> x={1,1,1,0,0,-1,-1,-1};
  vector<int> y={1,0,-1,1,-1,1,0,-1};
  for(int i=0;i<h;++i){
    for(int j=0;j<w;++j){
      if(str[i][j]=='#')continue;
      for(int k=0;k<8;++k){
        int ni=i+x[k];
        int nj=j+y[k];
        int num=0;
        if(ni<0||ni>=h)continue;
        if(nj<0||nj>=w)continue;
        if(str[ni][nj]=='#')++num;
        str[i][j]=num+'0';  
    }
      cout<<str[i]<<endl;
  }  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:32: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
    8 |   for(int i=0;i<h;++i) cin>>str(i);
      |                             ~~~^~~
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define ff first
#define ss second
#define ll long long
#define vi vector<int>
#define vii vector<vi>
#define vs vector<string>
#define vss vector<vs>
#define pii pair<int, int>
#define all(x) x.begin(), x.end()
#define rep(i, a, n) for (ll i = (a); i < (n); ++i)
#define repr(i, a, n) for (ll i = (n); i >= (a); --i)
using namespace std;
const int INF(1 << 30);
const ll LLINF(1LL << 55LL);
const int pi = 3.1415926536;
const int MOD = 1000000007;
const int MAX = 510000;

void Main() {
  int H, W;
  cin >> H >> W;
  string S[H];
  rep(i, 0, H) { cin >> S[i]; }

  //  八方向で隣接しているマスに'#'があるか調べる。
  rep(i, 0, H) {    // 行
    rep(j, 0, W) {  //　列
      if (S[i][j] == '#') {
        cout << '#' continue;
      }
      int cnt = 0;
      rep(k, j - 1, j + 2) {
        if (S[i - 1][k] == '#') cnt++;
        if (S[i + 1][k] == '#') cnt++;
      }
      if (S[i][j - 1] == '#') cnt++;
      if (S[i][j + 1] == '#') cnt++;
      cout << cnt;
    }
    cout << endl;
  }
}

int main() {
  std::cin.tie(nullptr);                  // 標準入出力高速化
  std::ios_base::sync_with_stdio(false);  // SとS++の入出力出力を非同期
  std::cout << std::fixed << std::setprecision(15);  // 小数を10進数表示
  Main();
}

Compiler output:
a.cc: In function 'void Main()':
a.cc:41:20: error: expected ';' before 'continue'
   41 |         cout << '#' continue;
      |                    ^~~~~~~~~
      |                    ;
Language: Java

import java.util.*;
 
public class B075 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();
        String [][] s = new String[H+2][W+2];
        int [][] t = new int[H+2][W+2];

        for(int i = 1 ; i <= H  ; i++){
            String[] str = sc.next().split("");
            for(int j = 1 ; j <= W ; j++){
                s[i][j] = str[j-1];
                t[i][j] = 0;
            }
        }

        for(int i = 1 ; i <= H  ; i++){
            for(int j = 1 ; j <= W ; j++){
                if(s[i][j].equals("#")){
                    t[i-1][j-1]++;
                    t[i-1][j]  ++;
                    t[i-1][j+1]++;
                    t[i][j-1]  ++;
                    t[i][j+1]  ++;
                    t[i+1][j-1]++;
                    t[i+1][j]  ++;
                    t[i+1][j+1]++;
                }
//                System.out.println(t[i][j]);
            }
        }

        for(int i = 1 ; i <= H  ; i++){
            for(int j = 1 ; j <= W ; j++){
                if(s[i][j].equals(".")){
                    s[i][j] = String.valueOf(t[i][j]);
                }
                System.out.print(s[i][j]);
            }
            System.out.println("");
        }
    }
}

Compiler output:
Main.java:3: error: class B075 is public, should be declared in a file named B075.java
public class B075 {
       ^
1 error
Language: C++

#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n);++i)
using namespace std;
typedef long long ll;

int main(){
    int H, W;
    cin >> H >> W;
    char S[50][50];
    char ans[50][50];
    int baku[50][50];
    rep(i, H){
        rep(j,W){
            cin >> S[i][j];
            baku[i][j] = 0;
        }
    }

    rep(i, H){
        rep(j,W){
            if (S[i][j] == '#'){
                ans[i][j] = '#';
                cout << ans[i][j];
                if (j != 0 && j == W-1) cout << endl;
                continue;
            }
            rep(k, 3)
            {
                rep(l,3){
                    if (S[k + i - 1][l + j - 1] == '#') baku[i][j]++;
                }
            }
          ans[i][j] = '0' + baku[i][j];
          cout << ans[i][j];
          if (j != 0 && j == W-1) cout << endl;
        }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:38:6: error: expected '}' at end of input
   38 |     }
      |      ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  int h, w;
  h = H + 2;
  w = W + 2;
  vector<char> s(h * w);
  for(int i = 0; i < (h * w); i++)
    if(i % w == 0 || (i + 1) % w == 0 || i < w || i > ((h - 1) * w))
      continue;
    cin >> s.at(i);
  for(int i = 0; i < (h * w); i++){
    if(i % w == 0 || (i + 1) % w == 0 || i < w || i > ((h - 1) * w))
      continue;
    int sum = 0;
    if(s.at(i) == '.'){
      s.at(i) = '0';
      if(s.at(i - W - 1) == '#')
        sum++;
      if(s.at(i - W) == '#')
        sum++;
      if(s.at(i - W + 1) == '#')
        sum++;
      if(s.at(i - 1) == '#')
        sum++;
      if(s.at(i + 1) == '#')
        sum++;
      if(s.at(i + W - 1) == '#')
        sum++;
      if(s.at(i + W) == '#')
        sum++;
      if(s.at(i + W + 1) == '#')
        sum++;
      if(sum == 1)
        s.at(i) = '1';
      if(sum == 2)
        s.at(i) = '2';
      if(sum == 3)
        s.at(i) = '3';
      if(sum == 4)
        s.at(i) = '4';
      if(sum == 5)
        s.at(i) = '5';
      if(sum == 6)
        s.at(i) = '6';
      if(sum == 7)
        s.at(i) = '7';
      if(sum == 8)
        s.at(i) = '8';
    }
  }
  for(int i = 0; i < (h * w); i++){
    if(i % w == 0 || (i + 1) % w == 0 || i < w || i > ((h - 1) * w))
      continue;
    cout << s.at(i);
    if((i + 2) % w == 0)
    cout << endl;
  }
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'i' was not declared in this scope
   14 |     cin >> s.at(i);
      |                 ^
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<char> s(H * W);
  for(int i = 0; i < (H * W); i++)
    cin >> s.at(i);
  for(int i = 0; i < (H * W); i++){
    int sum = 0;
    if(s.at(i) == '.'){
      s.at(i) = '0'
      if(s.at(i - W - 1) == '#')
        sum++;
      if(s.at(i - W) == '#')
        sum++;
      if(s.at(i - W + 1) == '#')
        sum++;
      if(s.at(i - 1) == '#')
        sum++;
      if(s.at(i + 1) == '#')
        sum++;
      if(s.at(i + W - 1) == '#')
        sum++;
      if(s.at(i + W) == '#')
        sum++;
      if(s.at(i + W + 1) == '#')
        sum++;
      if(sum == 1)
        s.at(i) = '1';
      if(sum == 2)
        s.at(i) = '2';
      if(sum == 3)
        s.at(i) = '3';
      if(sum == 4)
        s.at(i) = '4';
      if(sum == 5)
        s.at(i) = '5';
      if(sum == 6)
        s.at(i) = '6';
      if(sum == 7)
        s.at(i) = '7';
      if(sum == 8)
        s.at(i) = '8';
    }
  }
  for(int i = 0; i < (H * W); i++){
    cout << s.at(i);
    if((i + 1) % W == 0)
    cout << endl;
  }
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: expected ';' before 'if'
   13 |       s.at(i) = '0'
      |                    ^
      |                    ;
   14 |       if(s.at(i - W - 1) == '#')
      |       ~~