criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <bits/stdc++.h>

using namespace std;

int NumMine(vector<string> &data,int i,int j){
    int num = 0;
    if (i>0){
        if(j>0){
            if(data[i-1].at(j-1)=='#'){
                num++;
            }
        }
        if(data[i-1].at(j)=='#'){
            num++;
        }
        if(j<(data[i-1].length()-1)){
            if(data[i-1].at(j+1)=='#'){
                num++;
            }
        }
    }
    if(j>0){
        if(data[i].at(j-1)=='#'){
            num++;
        }
    }
    if(j<(data[i].length()-1)){
        if(data[i].at(j+1)=='#'){
            num++;
        }
    }

    if (i<(data.size()-1)){
        if(j>0){
            if(data[i+1].at(j-1)=='#'){
                num++;
            }
        }
        if(data[i+1].at(j)=='#'){
            num++;
        }
        if(j<(data[i+1].length()-1)){
            if(data[i+1].at(j+1)=='#'){
                num++;
            }
        }
    }
    return num;
}

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

    vector<string> data(H);

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

    for (int i = 0; i < H;i++){
        for (int j = 0; j < W;j++){
            if(data[i].at(j)!='.'){
                continue;
            }else{
                data[i][j] = '0'+NumMine(data, i, j);
            }
        }
    }

    for (int i = 0; i < H;i++){
        cout << data[i] << endl;
    }
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<vector>

using namespace std;

int NumMine(vector<string> &data,int i,int j){
    int num = 0;
    if (i>0){
        if(j>0){
            if(data[i-1].at(j-1)=='#'){
                num++;
            }
        }
        if(data[i-1].at(j)=='#'){
            num++;
        }
        if(j<(data[i-1].length()-1)){
            if(data[i-1].at(j+1)=='#'){
                num++;
            }
        }
    }
    if(j>0){
        if(data[i].at(j-1)=='#'){
            num++;
        }
    }
    if(j<(data[i].length()-1)){
        if(data[i].at(j+1)=='#'){
            num++;
        }
    }

    if (i<(data.size()-1)){
        if(j>0){
            if(data[i+1].at(j-1)=='#'){
                num++;
            }
        }
        if(data[i+1].at(j)=='#'){
            num++;
        }
        if(j<(data[i+1].length()-1)){
            if(data[i+1].at(j+1)=='#'){
                num++;
            }
        }
    }
    return num;
}

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

    vector<string> data(H);

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

    for (int i = 0; i < H;i++){
        for (int j = 0; j < W;j++){
            if(data[i].at(j)!='.'){
                continue;
            }else{
                data[i][j] = '0'+NumMine(data, i, j);
            }
        }
    }

    for (int i = 0; i < H;i++){
        cout << data[i] << endl;
    }
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<string> S;
  for (int i = 0; i < H; i++) {
    cin >> S[i];
  
    for (int z = 0; z < W; z++) {
      int count = 0;
      if (S[i].at(z) == '#') {
        continue;
      }
      if else (S[i - 1].at(z - 1) == '#') {
        count++;
      } 
      if else (S[i - 1].at(z) == '#') {
        count++;
      }
      if else (S[i - 1].at(z + 1) == '#') {
        count++;
      }
      if else (S[i].at(z - 1) == '#') {
        count++;
      }
      if else (S[i].at(z + 1) == '#') {
        count++;
      }
      if else (S[i + 1].at(z - 1) == '#') {
        count++;
      }
      if else (S[i + 1].at(z) == '#') {
        count++;
      }
      if else (S[i + 1].at(z + 1) == '#') {
        count++;
      }
      S[i].at(z) == 'count':
    }
    
}

Compiler output:
a.cc:40:21: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   40 |       S[i].at(z) == 'count':
      |                     ^~~~~~~
a.cc: In function 'int main()':
a.cc:16:10: error: expected '(' before 'else'
   16 |       if else (S[i - 1].at(z - 1) == '#') {
      |          ^~~~
      |          (
a.cc:19:10: error: expected '(' before 'else'
   19 |       if else (S[i - 1].at(z) == '#') {
      |          ^~~~
      |          (
a.cc:22:10: error: expected '(' before 'else'
   22 |       if else (S[i - 1].at(z + 1) == '#') {
      |          ^~~~
      |          (
a.cc:25:10: error: expected '(' before 'else'
   25 |       if else (S[i].at(z - 1) == '#') {
      |          ^~~~
      |          (
a.cc:28:10: error: expected '(' before 'else'
   28 |       if else (S[i].at(z + 1) == '#') {
      |          ^~~~
      |          (
a.cc:31:10: error: expected '(' before 'else'
   31 |       if else (S[i + 1].at(z - 1) == '#') {
      |          ^~~~
      |          (
a.cc:34:10: error: expected '(' before 'else'
   34 |       if else (S[i + 1].at(z) == '#') {
      |          ^~~~
      |          (
a.cc:37:10: error: expected '(' before 'else'
   37 |       if else (S[i + 1].at(z + 1) == '#') {
      |          ^~~~
      |          (
a.cc:40:28: error: expected ';' before ':' token
   40 |       S[i].at(z) == 'count':
      |                            ^
      |                            ;
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<string> S;
  for (int i = 0; i < H; i++) {
    cin >> S[i];
  
    for (int z = 0; z < W; z++) {
      int count = 0;
      if (S[i].at(z) == '#') {
        continue;
      }
      if else (S[i - 1].at(z - 1) == '#') {
        count++;
      } 
      if else (S[i - 1].at(z) == '#') {
        count++;
      }
      if else (S[i - 1].at(z + 1) == '#') {
        count++;
      }
      if else (S[i].at(z - 1) == '#') {
        count++;
      }
      if else (S[i].at(z + 1) == '#') {
        count++;
      }
      if else (S[i + 1].at(z - 1) == '#') {
        count++;
      }
      if else (S[i + 1].at(z) == '#') {
        count++;
      }
      if else (S[i + 1].at(z + 1) == '#') {
        count++;
      }
      S[i].at(z) == 'count'
    }
    
}

Compiler output:
a.cc:40:21: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   40 |       S[i].at(z) == 'count'
      |                     ^~~~~~~
a.cc: In function 'int main()':
a.cc:16:10: error: expected '(' before 'else'
   16 |       if else (S[i - 1].at(z - 1) == '#') {
      |          ^~~~
      |          (
a.cc:19:10: error: expected '(' before 'else'
   19 |       if else (S[i - 1].at(z) == '#') {
      |          ^~~~
      |          (
a.cc:22:10: error: expected '(' before 'else'
   22 |       if else (S[i - 1].at(z + 1) == '#') {
      |          ^~~~
      |          (
a.cc:25:10: error: expected '(' before 'else'
   25 |       if else (S[i].at(z - 1) == '#') {
      |          ^~~~
      |          (
a.cc:28:10: error: expected '(' before 'else'
   28 |       if else (S[i].at(z + 1) == '#') {
      |          ^~~~
      |          (
a.cc:31:10: error: expected '(' before 'else'
   31 |       if else (S[i + 1].at(z - 1) == '#') {
      |          ^~~~
      |          (
a.cc:34:10: error: expected '(' before 'else'
   34 |       if else (S[i + 1].at(z) == '#') {
      |          ^~~~
      |          (
a.cc:37:10: error: expected '(' before 'else'
   37 |       if else (S[i + 1].at(z + 1) == '#') {
      |          ^~~~
      |          (
a.cc:40:28: error: expected ';' before '}' token
   40 |       S[i].at(z) == 'count'
      |                            ^
      |                            ;
   41 |     }
      |     ~                       
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main(){
  int H,W,cnt;
  string line,tmp;
  cin >> H >> W;
  cnt=0;
  for(int i=0;i<H;i++){
    cin >> tmp;
    line+=tmp;
  }
  for(int i=0;i<H*W;i++){
    if(line.at(i)=='#'){
      cout << '#';
      continue;
    }
    if(i-W-1>=0&&line.at(i-W-1)=='#')cnt++;
    if(i-W>=0&&line.at(i-W)=='#')cnt++;
    if(i-W+1>=0&&line.at(i-W+1)=='#')cnt++;
    if(i-1>=0&&line.at(i-1)=='#')cnt++;
    if(i+1<W*H&&line.at(i+1)=='#')cnt++;
    if(i+W-1<&&W*Hline.at(i+W-1)=='#')cnt++;
    if(i+W<&&W*Hline.at(i+W)=='#')cnt++;
    if(i+W+1<&&W*Hline.at(i+W+1)=='#')cnt++;
    cout << cnt;
    cnt=0;
    if(cnt%W==0)cout << endl;
  }
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: 'Hline' was not declared in this scope; did you mean 'line'?
   23 |     if(i+W-1<&&W*Hline.at(i+W-1)=='#')cnt++;
      |                  ^~~~~
      |                  line
a.cc:24:16: error: 'Hline' was not declared in this scope; did you mean 'line'?
   24 |     if(i+W<&&W*Hline.at(i+W)=='#')cnt++;
      |                ^~~~~
      |                line
a.cc:25:18: error: 'Hline' was not declared in this scope; did you mean 'line'?
   25 |     if(i+W+1<&&W*Hline.at(i+W+1)=='#')cnt++;
      |                  ^~~~~
      |                  line
a.cc:23:16: error: label 'W' used but not defined
   23 |     if(i+W-1<&&W*Hline.at(i+W-1)=='#')cnt++;
      |                ^
Language: C++

#include <bit/stdc++.h>
int main(void) {
 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:1:10: fatal error: bit/stdc++.h: No such file or directory
    1 | #include <bit/stdc++.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  int H,W,cnt1=0,cnt2=0;
  string len1,tmp;
  //入力フェイズ
  cin >> H >> W;
  for(int i=0;i<W;i++){
    cin >> tmp;
    len1+=tmp;
  }
  //出力フェイズ
  for(int i=0;i<H*W;i++){
    int k=0;
    //爆弾だったら
    if(len1.at(i)=='#'){
      cnt1=0;
      cnt2=0;
      cout << '#';
      continue;
     }
    k=-7;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=-6;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=-5;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=-1;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=1;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=5;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=6;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=7;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    cout << cnt1 << endl;
    k=0;
    cnt1=0;
    cnt2++;
    if(cont2==W){
      cnt2=0;
      cout << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:8: error: 'cont2' was not declared in this scope; did you mean 'cnt2'?
   35 |     if(cont2==W){
      |        ^~~~~
      |        cnt2
Language: C++

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

int main(){
  int H,W,cnt1=0,cnt2=0;
  string len1,tmp;
  //入力フェイズ
  cin >> H >> W;
  for(int i=0;i<W;i++){
    cin >> tmp;
    len1+=tmp;
  }
  //出力フェイズ
  for(int i=0;i<H*W;i++){
    int k=0;
    //爆弾だったら
    if(len1.at(i)=='#'){
      cnt1=0;
      cnt2=0;
      cout << '#';
      continue;
     }
    k=-7;if(i+k>=0&&len1.at(i+k)=='#')cn1t++;
    k=-6;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=-5;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=-1;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=1;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=5;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=6;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=7;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    cout << cnt1 << endl;
    k=0;
    cnt1=0;
    cnt2++;
    if(cont2==W){
      cont2=0;
      cout << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:39: error: 'cn1t' was not declared in this scope; did you mean 'cnt1'?
   23 |     k=-7;if(i+k>=0&&len1.at(i+k)=='#')cn1t++;
      |                                       ^~~~
      |                                       cnt1
a.cc:35:8: error: 'cont2' was not declared in this scope; did you mean 'cnt2'?
   35 |     if(cont2==W){
      |        ^~~~~
      |        cnt2
Language: C++

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

int main(){
  int H,W,cnt1=0,cnt2=0;
  string len1,tmp;
  //入力フェイズ
  cin >> H >> W;
  for(int i=0;i<W;i++){
    cin >> tmp;
    len1+=tmp;
  }
  //出力フェイズ
  for(int i=0;i<H*W;i++){
    int k=0;
    //爆弾だったら
    if(len1.at(i*W+j)=='#'){
      cnt1=0;
      cnt2=0;
      cout << '#';
      continue;
     }
    k=-7;if(i+k>=0&&len1.at(i+k)=='#')cn1t++;
    k=-6;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=-5;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=-1;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=1;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=5;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=6;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    k=7;if(i+k>=0&&len1.at(i+k)=='#')cnt1++;
    cout << cnt1 << endl;
    k=0;
    cnt1=0;
    cnt2++;
    if(cont2==W){
      cont2=0;
      cout << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: 'j' was not declared in this scope
   17 |     if(len1.at(i*W+j)=='#'){
      |                    ^
a.cc:23:39: error: 'cn1t' was not declared in this scope; did you mean 'cnt1'?
   23 |     k=-7;if(i+k>=0&&len1.at(i+k)=='#')cn1t++;
      |                                       ^~~~
      |                                       cnt1
a.cc:35:8: error: 'cont2' was not declared in this scope; did you mean 'cnt2'?
   35 |     if(cont2==W){
      |        ^~~~~
      |        cnt2
Language: C++

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

int main(){
  int H,W,cnt1=0,cnt2=0;
  string len1,tmp;
  //入力フェイズ
  cin >> H >> W;
  for(int i=0;i<W;i++){
    cin >> tmp;
    len1+=tmp;
  }
  //出力フェイズ
  for(int i=0;i<H*W;i++){
    int k=0;
    //爆弾だったら
    if(len1.at(i*W+j)=='#'){
      cnt1=0;
      cnt2=0;
      cout << '#';
      continue;
     }
    k=-7;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cn1t++;
    k=-6;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=-5;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=-1;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=1;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=5;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=6;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=7;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    cout << cnt1 << endl;
    cnt1=0;
    cnt2++;
    if(cont2==W){
      cont2=0;
      cout << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: 'j' was not declared in this scope
   17 |     if(len1.at(i*W+j)=='#'){
      |                    ^
a.cc:23:17: error: 'j' was not declared in this scope
   23 |     k=-7;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cn1t++;
      |                 ^
a.cc:23:47: error: 'cn1t' was not declared in this scope; did you mean 'cnt1'?
   23 |     k=-7;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cn1t++;
      |                                               ^~~~
      |                                               cnt1
a.cc:24:17: error: 'j' was not declared in this scope
   24 |     k=-6;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                 ^
a.cc:25:17: error: 'j' was not declared in this scope
   25 |     k=-5;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                 ^
a.cc:26:17: error: 'j' was not declared in this scope
   26 |     k=-1;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                 ^
a.cc:27:16: error: 'j' was not declared in this scope
   27 |     k=1;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                ^
a.cc:28:16: error: 'j' was not declared in this scope
   28 |     k=5;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                ^
a.cc:29:16: error: 'j' was not declared in this scope
   29 |     k=6;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                ^
a.cc:30:16: error: 'j' was not declared in this scope
   30 |     k=7;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                ^
a.cc:34:8: error: 'cont2' was not declared in this scope; did you mean 'cnt2'?
   34 |     if(cont2==W){
      |        ^~~~~
      |        cnt2
Language: C++

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

int main(){
  int H,W,cnt1=0,cnt2=0;
  string len1,tmp;
  //入力フェイズ
  cin >> H >> W;
  for(int i=0;i<W;i++){
    cin >> tmp;
    len1+=tmp;
  }
  //出力フェイズ
  for(int i=0;i<H*W;i++){
    int k=0;
    //爆弾だったら
    if(len1.at(i*W+j)=='#'){
      cnt1=0;
      cnt2=0;
      cout << '#';
      continue;
     }
    k=-7;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cn1t++;
    k=-6;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=-5;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=-1;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=1;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=5;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=6;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    k=7;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
    cout << cnt << endl;
    cnt1=0;
    cnt2++;
    if(cont2==W){
      cont2=0;
      cout << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: 'j' was not declared in this scope
   17 |     if(len1.at(i*W+j)=='#'){
      |                    ^
a.cc:23:17: error: 'j' was not declared in this scope
   23 |     k=-7;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cn1t++;
      |                 ^
a.cc:23:47: error: 'cn1t' was not declared in this scope; did you mean 'cnt1'?
   23 |     k=-7;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cn1t++;
      |                                               ^~~~
      |                                               cnt1
a.cc:24:17: error: 'j' was not declared in this scope
   24 |     k=-6;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                 ^
a.cc:25:17: error: 'j' was not declared in this scope
   25 |     k=-5;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                 ^
a.cc:26:17: error: 'j' was not declared in this scope
   26 |     k=-1;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                 ^
a.cc:27:16: error: 'j' was not declared in this scope
   27 |     k=1;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                ^
a.cc:28:16: error: 'j' was not declared in this scope
   28 |     k=5;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                ^
a.cc:29:16: error: 'j' was not declared in this scope
   29 |     k=6;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                ^
a.cc:30:16: error: 'j' was not declared in this scope
   30 |     k=7;if(i*W+j+k>=0&&len1.at(i*W+j+k)=='#')cnt1++;
      |                ^
a.cc:31:13: error: 'cnt' was not declared in this scope; did you mean 'cnt2'?
   31 |     cout << cnt << endl;
      |             ^~~
      |             cnt2
a.cc:34:8: error: 'cont2' was not declared in this scope; did you mean 'cnt2'?
   34 |     if(cont2==W){
      |        ^~~~~
      |        cnt2
Language: C++

#include <iostream>
using namespace std;
#define rep(i, H) for (int i = 0; i < (int)(H); ++i)
#define rep(j, W) for (int i = 0; k < (int)(W); ++k)

int main() {
  int H,W,k,l;
  string S,SC;
  cin >> H >> W;
  for(i=0;i<H;++i){
    cin >> SC;
    S += SC;
  }
  for(i=0;i<H;++i)
    for(j=0;j<W;++j)
      if(S.at(i*W+j)=='#')
        for(k=(i-(i>0)) ; k<(i+1+(i<(H-1))) ; ++k)
          for(l=(j-(j>0)) ; l<(j+1+(j<(W-1))) ; ++l)
            if(S.at(k*W+l)!='#')
              S.at(k*W+l)+=1;
  for(i=0;i<H;++i){
    for(j=0;j<W;++j){
      if(S.at(i*W+j)!='#')
        S.at(i*W+j) += '0' - '.';
      cout << S.at(i*W+j);
    }
    cout << endl;
  }
}


Compiler output:
a.cc:4:9: warning: "rep" redefined
    4 | #define rep(j, W) for (int i = 0; k < (int)(W); ++k)
      |         ^~~
a.cc:3:9: note: this is the location of the previous definition
    3 | #define rep(i, H) for (int i = 0; i < (int)(H); ++i)
      |         ^~~
a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   for(i=0;i<H;++i){
      |       ^
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   for(i=0;i<H;++i)
      |       ^
a.cc:15:9: error: 'j' was not declared in this scope
   15 |     for(j=0;j<W;++j)
      |         ^
a.cc:21:7: error: 'i' was not declared in this scope
   21 |   for(i=0;i<H;++i){
      |       ^
a.cc:22:9: error: 'j' was not declared in this scope
   22 |     for(j=0;j<W;++j){
      |         ^
Language: C++

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

int main() {
  int H,W;
  string S,SC;
  for(int i=0;i<H;++i){
    cin >> SC;
    S += SC;
    for(int j=0;j<W;++j)
      if(S.at[i*W+j] == '#')
        for(int k=(j-(j>0));k<(j+1);++k)
          for(int l=(i-(i>0));l<(i+1);++l)
            S.at[k+l*H] += 1;
  }
    
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   11 |       if(S.at[i*W+j] == '#')
      |              ^
a.cc:14:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   14 |             S.at[k+l*H] += 1;
      |                 ^
Language: C++

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

int main() {
  int H,W;
  string S,SC;
  for(int i=0;i<H;++i){
    cin >> SC;
    S += SC;
    for(int j=0;j<W;++j)
      if(S.at[i*W+j] == '#')
        for(int k=(j-(j>0));k<(j+1);++k)
          for(int l=(i-(i>0));l<(i+1);++l)
            S.at[k+l*H] += 1;
    
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   11 |       if(S.at[i*W+j] == '#')
      |              ^
a.cc:14:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   14 |             S.at[k+l*H] += 1;
      |                 ^
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int H = sc.nextInt();
    int W = sc.nextInt();
    char grid[][] = new char [H][W];
    for(int i=0; i<H; i++){
      for(int j=0; j<W; j++){
        grid[i][j]=sc.next();
      }
    }
    
    int cnt[][] = new int [H][W];
    for(int i=0; i<H; i++){
      for(int j=0; j<W; j++){
        if(grid[i][j] == '#'){
          cnt[i][j] = -1;
          continue;
        }
        if(j-1>=0 && grid[i][j-1] == '#'){
          cnt[i][j]++;
        }//left
        if(j+1<W && grid[i][j+1] == '#'){
          cnt[i][j]++;
        }//right
        if(i-1>=0 && grid[i-1][j] == '#'){
          cnt[i][j]++;
        }//up
        if(i+1<H && grid[i+1][j] == '#'){
          cnt[i][j]++;
        }//down
        if(i-1>=0 && j-1>=0 && grid[i-1][j-1] == '#'){
          cnt[i][j]++;
        }//left-up
        if(i-1>=0 && j+1<W && grid[i-1][j+1] == '#'){
          cnt[i][j]++;
        }//right-up
        if(i+1<H && j+1<W && grid[i+1][j+1] == '#'){
          cnt[i][j]++;
        }//left-down
        if(i+1<H && j-1>=0 && grid[i+1][j-1] == '#'){
          cnt[i][j]++;
        }//right-down
      }
    }
    String ans = "";
    for(int i=0; i<H; i++){
      for(int j=0; j<W; j++){
        if(cnt[i][j]==-1){
          ans += '#';
        }else {
          ans += cnt[i][j];
        }
      }
      System.out.println(ans);
      ans = ""; 
    }
  }
}
    

Compiler output:
Main.java:11: error: incompatible types: String cannot be converted to char
        grid[i][j]=sc.next();
                          ^
1 error
Language: C++

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

int main() {
  int H, W;
  vector<string> vec(H);
  
  // input
  cin >> H >> W;
  for (int i=0; i < H; i++) {
    cin >> vec.at(i);
  }
  
  int count;
  // main loop
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (vec.at(i).at(j) != '#') { 
        count = 0;
        for (int di = -1; di <= 1; di++) {
          for (int dj = -1; dj <= 1; dj++) {
            if (i + di >= 0 && i + di < H && j + dj >= 0 && j + dj < W) {
              if (vec.at(i+di).at(j+dj) == '#') {
                count++;
              }
            }
          }
        }
        vec.at(i+di).at(j+dj) = count;
      }
    }
  }
  
  for (int i = 0; i < H; i++) {
    cout << vec.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: 'di' was not declared in this scope; did you mean 'i'?
   29 |         vec.at(i+di).at(j+dj) = count;
      |                  ^~
      |                  i
a.cc:29:27: error: 'dj' was not declared in this scope; did you mean 'j'?
   29 |         vec.at(i+di).at(j+dj) = count;
      |                           ^~
      |                           j
Language: C++

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

int main() {
  int H, W;
  vector<string> vec(H);
  
  // input
  cin >> H >> W;
  for (int i=0; i < H; i++) {
    cin >> vec.at(i);
  }
  
  int count;
  // main loop
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (vec.at(i).at(j) != "#") { 
        count = 0;
        for (int di = -1; di <= 1; di++) {
          for (int dj = -1; dj <= 1; dj++) {
            if (i + di >= 0 && i + di < H && j + dj >= 0 && j + dj < W) {
              if (vec.at(i+di).at(j+dj) == "#") {
                count++;
              }
            }
          }
        }
        vec.at(i+di).at(j+dj) = count;
      }
    }
  }
  
  for (int i = 0; i < H; i++) {
    cout << vec.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |       if (vec.at(i).at(j) != "#") {
      |           ~~~~~~~~~~~~~~~~^~~~~~
a.cc:23:41: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |               if (vec.at(i+di).at(j+dj) == "#") {
      |                   ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:29:18: error: 'di' was not declared in this scope; did you mean 'i'?
   29 |         vec.at(i+di).at(j+dj) = count;
      |                  ^~
      |                  i
a.cc:29:27: error: 'dj' was not declared in this scope; did you mean 'j'?
   29 |         vec.at(i+di).at(j+dj) = count;
      |                           ^~
      |                           j
Language: C++

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {
	int H, W;
	cin >> H >> W;
	string masu[H] = {};
	vector<vector<char>> c < H, vector<char>(W));
	int m[H][W] = {};
	rep(i, H) {
		rep(j, W) {
			cin >> c[i][j];
		}
	}
	rep(i, H) {
		rep(j, W) {
			if (c[i][j] == '#') {
				for (int dx = -1; dx <= 1; dx++) {
					for (int dy = -1; dy <= 1; dy++) {
						int nx = i + dx;
						int ny = j + dy;
						if (0 <= nx && nx <= H && 0 <= ny && ny <= W) {
							m[nx][ny]++;
						}
					}
				}
			}
		}
	}

	rep(i, H) {
		rep(j, W) {
			if (c[i][j] == '#') {
				cout << "#";
			}
			else {
				cout << m[i][j];
			}
		}
		cout << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:32: error: expected initializer before '<' token
   12 |         vector<vector<char>> c < H, vector<char>(W));
      |                                ^
a.cc:16:32: error: 'c' was not declared in this scope
   16 |                         cin >> c[i][j];
      |                                ^
a.cc:21:29: error: 'c' was not declared in this scope
   21 |                         if (c[i][j] == '#') {
      |                             ^
a.cc:37:29: error: 'c' was not declared in this scope
   37 |                         if (c[i][j] == '#') {
      |                             ^
Language: C++

#include <stdio.h>
#include <string.h>
#include <iostream>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {
	int H, W;
	cin >> H >> W;
	string masu[H] = {};
	vector<vector<char>> c < H, vector<char>(W));
	int m[H][W] = {};
	rep(i, H) {
		rep(j, W) {
			cin >> c[i][j];
		}
	}
	rep(i, H) {
		rep(j, W) {
			if (c[i][j] == '#') {
				for (int dx = -1; dx <= 1; dx++) {
					for (int dy = -1; dy <= 1; dy++) {
						int nx = i + dx;
						int ny = j + dy;
						if (0 <= nx && nx <= H && 0 <= ny && ny <= W) {
							m[nx][ny]++;
						}
					}
				}
			}
		}
	}

	rep(i, H) {
		rep(j, W) {
			if (c[i][j] == '#') {
				cout << "#";
			}
			else {
				cout << m[i][j];
			}
		}
		cout << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'vector' was not declared in this scope
   11 |         vector<vector<char>> c < H, vector<char>(W));
      |         ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <iostream>
  +++ |+#include <vector>
    4 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
a.cc:11:23: error: expected primary-expression before 'char'
   11 |         vector<vector<char>> c < H, vector<char>(W));
      |                       ^~~~
a.cc:15:32: error: 'c' was not declared in this scope
   15 |                         cin >> c[i][j];
      |                                ^
a.cc:20:29: error: 'c' was not declared in this scope
   20 |                         if (c[i][j] == '#') {
      |                             ^
a.cc:36:29: error: 'c' was not declared in this scope
   36 |                         if (c[i][j] == '#') {
      |                             ^
Language: C++

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

int main() {
  int H, W, c;
  cin >> H >> W;
  string s1, s2, s3;
  
  for(int i = 0;i < H;i++){
    if(i==0){
      cin >> s2 >> s3;
    }else if(i==H-1){
    }else{
      cin >> s3;
    }
    for(int j = 0;j < W;j++){
      c=0;
      if(s2.at(j) == '.'){
        if(i==0){
          if(j==0){
            if(s2.at(1) == '#')
              c++;
            if(s3.at(0) == '#')
              c++;
            if(s3.at(1) == '#')
              c++;
          }else if(j==W-1){
            if(s2.at(j-1) == '#')
              c++;
            if(s3.at(j-1) == '#')
              c++;
            if(s3.at(j) == '#')
              c++;
          }else{
            if(s2.at(j-1) == '#')
              c++;
            if(s2.at(j+1) == '#')
              c++;
            if(s3.at(j-1) == '#')
              c++;
            if(s3.at(j) == '#')
              c++;
            if(s3.at(j+1) == '#')
              c++;
          }
        }else if(i==H-1){
          if(j==0){
            if(s2.at(1) == '#')
              c++;
            if(s1.at(0) == '#')
              c++;
            if(s1.at(1) == '#')
              c++;
          }else if(j==W-1){
            if(s2.at(j-1) == '#')
              c++;
            if(s1.at(j-1) == '#')
              c++;
            if(s1.at(j) == '#')
              c++;
          }else{
            if(s2.at(j-1) == '#')
              c++;
            if(s2.at(j+1) == '#')
              c++;
            if(s1.at(j-1) == '#')
              c++;
            if(s1.at(j) == '#')
              c++;
            if(s1.at(j+1) == '#')
              c++;
          }
        }else{
          if(j==0){
            if(s1.at(0) == '#')
              c++;
            if(s1.at(1) == '#')
              c++;
            if(s2.at(1) == '#')
              c++;
            if(s3.at(0) == '#')
              c++;
            if(s3.at(1) == '#')
              c++;
          }else if(j==W-1){
            if(s1.at(j-1) == '#')
              c++;
            if(s1.at(j) == '#')
              c++;
            if(s2.at(j-1) == '#')
              c++;
            if(s3.at(j-1) == '#')
              c++;
            if(s3.at(j) == '#')
              c++;
          }else{
            if(s1.at(j-1) == '#')
              c++;
            if(s1.at(j) == '#')
              c++;
            if(s1.at(j+1) == '#')
              c++;
            if(s2.at(j-1) == '#')
              c++;
            if(s2.at(j+1) == '#')
              c++;
            if(s3.at(j-1) == '#')
              c++;
            if(s3.at(j) == '#')
              c++;
            if(s3.at(j+1) == '#')
              c++;
          }
        }
        cout << c;
      }else{
      cout << '#';
      }
    }
  }
  cout << endl;
  s1=s2;
  s2=s3;
  }
      
}


Compiler output:
a.cc:126:1: error: expected declaration before '}' token
  126 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int i, j;
  
  int h, w;
  cin >> h >> w;
  
  vector<string> s(h);
  for (i = 0; i < h; i++) {
    cin >> s[i];
  }
  
  int is, ie, js, je;
  for (i = 0; i < h; i++) {
    if (0 < i || i < h) {
      is = -1; ie = 1;
    } else if (i == 0) {
      is = 0; ie = 1;
    } else {
      is = -1; ie = 0;
    }
  for (j = 0; j < w; j++) {
    if (0 < j || j < w) {
      js = -1; je = 1;
    } else if (i == 0) {
      js = 0; je = 1;
    } else {
      js = -1; je = 0;
    }
    
    if (s[i][j] == '.') {
      int count = 0;
      for (int ii = i + is; ii <= i + ie; ii++) {
      for (int jj = j + js; jj <= j + je; jj++) {
        if (s[ii][jj] == '#') {
          count++;
        }
      }
      }
    }
    
    s[i][j] = count;
  }
  }
  
  for (i = 0; i < h; i++) {
    cout << s[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:15: error: cannot resolve overloaded function 'count' based on conversion to type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   44 |     s[i][j] = count;
      |               ^~~~~
Language: C++

1 int main(void) {
2 int h, w;
3 cin >> h >> w;
4
5 string board[50];
6
7 for (int i = 0; i < h; ++i) cin >> board[i];
8
9 const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
10 const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
11
12 for (int i = 0; i < h; ++i) {
13 for (int j = 0; j < w; ++j) {
14 if (board[i][j] == ’#’) continue;
15
16 int num = 0;
17 for (int d = 0; d < 8; ++ d) {
18 const int ni = i + dy[d];
19 const int nj = j + dx[d];
20
21 if (ni < 0 or h <= ni) continue;
22 if (nj < 0 or w <= nj) continue;
23 if (board[ni][nj] == ’#’) num++;
24 }
25
26 board[i][j] = char(num + ’0’);
27
28 }
29 }
30
31 for (int i = 0; i < h; ++i) cout << board[i] << endl;
32
33 return 0;
34 }

Compiler output:
a.cc:14:23: error: extended character ’ is not valid in an identifier
   14 | 14 if (board[i][j] == ’#’) continue;
      |                       ^
a.cc:14:24: error: stray '#' in program
   14 | 14 if (board[i][j] == ’#’) continue;
      |                        ^
a.cc:14:25: error: extended character ’ is not valid in an identifier
   14 | 14 if (board[i][j] == ’#’) continue;
      |                         ^
a.cc:23:25: error: extended character ’ is not valid in an identifier
   23 | 23 if (board[ni][nj] == ’#’) num++;
      |                         ^
a.cc:23:26: error: stray '#' in program
   23 | 23 if (board[ni][nj] == ’#’) num++;
      |                          ^
a.cc:23:27: error: extended character ’ is not valid in an identifier
   23 | 23 if (board[ni][nj] == ’#’) num++;
      |                           ^
a.cc:26:29: error: extended character ’ is not valid in an identifier
   26 | 26 board[i][j] = char(num + ’0’);
      |                             ^
a.cc:26:29: error: extended character ’ is not valid in an identifier
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1 int main(void) {
      | ^
Language: C

#include <bits/stdc++.h>
using namespace std;
#define dout cout
#ifndef dout
#define //
#endif

int main(){
    char map[50+2][50+2];//vector忘れた、場合分け避けるために一周多く作ってる

    int H,W;
    cin>>H>>W;
    //dout<<"H:"<<H<<"W:"<<W<<"\n";
    char c;
    for(int i = 0; i < H; i++){//////////////入力
        for(int j=0; j<W; j++){
            cin>>c;
            if(c=='.'){//ドット
                map[i+1][j+1] = '0';
            }
            else{//爆弾
                map[i+1][j+1] = '#';
            }
        }
    }

    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            if(map[i+1][j+1] == '#'){///////爆弾なら周り8マスに+1する
                if(map[i+0][j+0] != '#') map[i+0][j+0]++;
                if(map[i+0][j+1] != '#') map[i+0][j+1]++;
                if(map[i+0][j+2] != '#') map[i+0][j+2]++;
                if(map[i+1][j+0] != '#') map[i+1][j+0]++;
                //map[i+1][j+1]
                if(map[i+1][j+2] != '#') map[i+1][j+2]++;
                if(map[i+2][j+0] != '#') map[i+2][j+0]++;
                if(map[i+2][j+1] != '#') map[i+2][j+1]++;
                if(map[i+2][j+2] != '#') map[i+2][j+2]++;
            }
        }
    }
    
    
   dout<<"\n\n";//////////////////////////////////////////
    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            cout<<map[i+1][j+1];
        }
        cout<<'\n';
    }
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {
  int H,W;
  cin >> H >> W;
  vector<vector<int>>data(H,vector<int>(W));
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      char a;
      cin >> char a;
      if(a=='.') data.at(i).at(j)=0;
      else data.at(i).at(j)=-1;
    }
  }
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(data.at(i).at(j)==0){
        int count=0;
        if(i!=0){
          if(data.at(i-1).at(j)==-1) count++;
        }
        if(i!=0&&j!=0){
          if(data.at(i-1).at(j-1)==-1) count++;
        }
        if(i!=0&&j!=W-1){
          if(data.at(i-1).at(j+1)==-1) count++;
        }
        if(j!=0){
          if(data.at(i).at(j-1)==-1) count++;
        }
        if(j!=W-1){
          if(data.at(i).at(j+1)==-1) count++;
        }
        if(i!=H-1){
          if(data.at(i+1).at(j)==-1) count++;
        }
        if(i!=H-1&&j!=0){
          if(data.at(i+1).at(j-1)==-1) count++;
        }
        if(i!=H-1&&j!=W-1){
          if(data.at(i+1).at(j+1)==-1) count++;
        }
        data.at(i).at(j)=count;
      }
    }
  }
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(data.at(i).at(j)==-1) cout << "#";
      else cout << data.at(i).at(j);
    }
    cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: expected primary-expression before 'char'
   11 |       cin >> char a;
      |              ^~~~
Language: C++

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

int main(){
  string num = "012345678";
  int H, W;
  cin >> H >> W;

  vector <string> Mine(H+2,"");
  for (int i=1; i<=H; i++){
    cin >> Mine.at(i);
  }

  for (int i=1; i<H; i++){
    string up,middle,down,kekka;
    up     = Mine.at(i-1);
    middle = Mine.at(i);
    down   = Mine.at(i+1);
    kekka  = "";
    for (int j=1; j<=W; j++){
      int N = 0;
      if ( up.at(j-1) == '.' ){ N++; }
      if ( up.at(j)   == '.' ){ N++; }
      if ( up.at(j+1) == '.' ){ N++; }
      if ( middle.at(j-1) == '.' ){ N++; }
      if ( middle.at(j+1) == '.' ){ N++; }   
      if ( down.at(j-1) == '.' ){ N++; }
      if ( down.at(j)   == '.' ){ N++; }
      if ( down.at(j+1) == '.' ){ N++; }
      if ( middle.at(j) == "#" ){
           kekka.at(j) = '#';
      } else {
           kekka.at(j) = num.at(j)
      }  
    }  
    cout << kekka << endl;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:30:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |       if ( middle.at(j) == "#" ){
      |            ~~~~~~~~~~~~~^~~~~~
a.cc:33:35: error: expected ';' before '}' token
   33 |            kekka.at(j) = num.at(j)
      |                                   ^
      |                                   ;
   34 |       }
      |       ~
Language: C++

//#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<cstdio>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<utility>
#include<algorithm>
#include<cstring>
#include<sstream>
#include <iomanip>

using namespace std;

typedef long long ll ;
typedef double db;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector< pair<int,int> > vii;
const double pi = 2*acos(0) ;

#define pf		  	printf
#define sf			  scanf
#define pb(a)         push_back(a)
#define mp			make_pair
#define fi			 first
#define se			 second
#define for0(i,n)        for(int i=0;i<n;i++)
#define for1(i,n)        for(int i=1;i<=n;i++)
#define forab(i,a,b)       for(int i=a;i<=b;i++)
#define lcm(a, b)     ((a)*((b)/gcd(a,b)))
#define sq(a)		   (a)*(a)
#define nw				"\n"
#define abs(x)		fabs(x)
#define pcase(z,x)    cout<<"Case "<<z<<": "<<x<<"\n"
int main()
{
	int i,j,h,w,c;
	cin>>h>>w;
	char s[100][100];
	memset(s,'.',sizeof(s));
	for1(i,h){
		for1(j,w) cin>>s[i][j];
		}
	for1(i,h){
		for1(j,w){
			if(s[i][j]=='.'){
				c=0;
				if(s[i][j+1]=='#') c++;
				if(s[i][j-1]=='#') c++;
				if(s[i+1][j] =='#') c++;
				if(s[i-1][j] == '#') c++;
				if(s[i-1][j+1] == '#') c++;
				if(s[i-1][j-1] == '#') c++;
				if(s[i+1][j-1] == '#') c++;
				if(s[i+1][j+1] == '#') c++;
				cout<<x;
				}
			else cout<<s[i][j];
			}
		cout<<nw;
		}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:39: error: 'x' was not declared in this scope
   60 |                                 cout<<x;
      |                                       ^
Language: C++

//#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<cstdio>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<utility>
#include<algorithm>
#include<cstring>
#include<sstream>
#include <iomanip>

using namespace std;

typedef long long ll ;
typedef double db;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector< pair<int,int> > vii;
const double pi = 2*acos(0) ;

#define pf		  	printf
#define sf			  scanf
#define pb(a)         push_back(a)
#define mp			make_pair
#define fi			 first
#define se			 second
#define for0(i,n)        for(int i=0;i<n;i++)
#define for1(i,n)        for(int i=1;i<=n;i++)
#define forab(i,a,b)       for(int i=a;i<=b;i++)
#define lcm(a, b)     ((a)*((b)/gcd(a,b)))
#define sq(a)		   (a)*(a)
#define nw				"\n"
#define abs(x)		fabs(x)
#define pcase(z,x)    cout<<"Case "<<z<<": "<<x<<"\n"
int main()
{
	int i,j,h,w,c;
	cin>>h>>w;
	char s[100][100];
	memset(s,'.',sizeof(s));
	for1(i,h){
		for1(j,w) cin>>s[i][j];
		}
	for1(i,h){
		for1(j,w){
			if(s[i][j]=='.'){
				c=0;
				if(s[i][j+1]=='#') c++;
				if(s[i][j-1]=='#') c++;
				if(s[i+1][j] =='#') c++;
				if(s[i-1][j] == '#') c++;
				if(s[i-1][j+1] == '#') c++;
				if(s[i-1][j-1] == '#') c++;
				if(s[i+1][j-1] == '#') c++;
				if(s[i+1][j+1] == '#') c++;
				cout<<x;
				}
			else cout<<s[i][j]
			}
		cout<<nw;
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:39: error: 'x' was not declared in this scope
   60 |                                 cout<<x;
      |                                       ^
a.cc:62:43: error: expected ';' before '}' token
   62 |                         else cout<<s[i][j]
      |                                           ^
      |                                           ;
   63 |                         }
      |                         ~
Language: C++

#define <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for(int i=a; i<b; i++)

char s[64][64];

int main(){
  int h, w; scanf("%d%d", &h, &w);
  REP(i, h) scanf("%s", s[i+1]+1);
  FOR(i, 1, h+1){
    FOR(j, 1, w+1){
      if(s[i][j] == '.'){
        s[i][j] = '0';
        REP(k, 3) REP(l, 3) if(s[i+k-1][i+l-1]=='#') s[i][j]++;
      }
    }
    printf("%s", s[i]+1);
  }
}

Compiler output:
a.cc:1:9: error: macro names must be identifiers
    1 | #define <bits/stdc++.h>
      |         ^
a.cc: In function 'int main()':
a.cc:9:13: error: 'scanf' was not declared in this scope
    9 |   int h, w; scanf("%d%d", &h, &w);
      |             ^~~~~
a.cc:18:5: error: 'printf' was not declared in this scope
   18 |     printf("%s", s[i]+1);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #define <bits/stdc++.h>
Language: Java

import java.util.*;

public class Main{
	
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	int h=sc.nextInt(),w=sc.nextInt();
    char[][] ch=new int[h][w];
    int[] dx={1,0,-1,0,1,-1,1,-1};
    int[] dy={0,1,0,-1,1,-1,-1,1};
    for(int i=0;i<h;i++){
      ch[i]=sc.next().toCharArray();
    }
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
        if(ch[i][j]=='#'){
          System.out.print(ch[i][j]);
        }else{
          int num=0;
          for(int d=0;d<8;d++){
            int ni=i+dx[d];
            int nj=j+dy[d];
            if(ni<0||ni>=h){
              continue;
            }else if(nj<0||nj>=w){
              continue;
            }else{
              if(ch[ni][nj]=='#'){
                num++;
              }
            }
          }
          System.out.print(num);
        }
      }
      System.out.print("\n");
    }
  }
}


Compiler output:
Main.java:8: error: incompatible types: int[][] cannot be converted to char[][]
    char[][] ch=new int[h][w];
                ^
1 error
Language: Java

import java.util.*;

public class Main{
	
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	int h=sc.nextInt(),w=sc.nextInt();
    char[][] ch=new int[h][w];
    int[] dx={1,0,-1,0,1,-1,1,-1};
    int[] dy={0,1,0,-1,1,-1,-1,1};
    for(int i=0;i<h;i++){
      ch[i]=sc.next().toCharArray();
    }
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
        if(ch[i][j]=='#'){
          System.out.print(ch[i][j]);
        }else{
          int num=0;
          for(int d=0,d<8;d++){
            int ni=i+dx[d];
            int nj=j+dy[d];
            if(ni<0||ni>=h){
              continue;
            }else if(nj<0||nj>=w){
              continue;
            }else{
              if(ch[ni][nj]=='#'){
                num++;
              }
            }
          }
          System.out.print(num);
        }
      }
      System.out.print("\n");
    }
  }
}


Compiler output:
Main.java:20: error: ';' expected
          for(int d=0,d<8;d++){
                       ^
Main.java:20: error: illegal start of type
          for(int d=0,d<8;d++){
                        ^
Main.java:20: error: ')' expected
          for(int d=0,d<8;d++){
                         ^
Main.java:20: error: ';' expected
          for(int d=0,d<8;d++){
                             ^
4 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, M;
  cin >> N >> M;
  vector<string> vec(N);
  for(int i = 0; i<N;i++){
    cin >> vec.at(i); 
  }
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
      if(vec.at(i).at(j)=='.'){
        int count;
        if(i>0&&vec.at(i-1).at(j)=='#'){
          count+=1;
        }
        if(i<(N-1)&&vec.at(i+1).at(j)=='#'){
          count+=1;
        }
        if(j>0&&vec.at(i).at(j-1)=='#'){
          count+=1;
        }
        if(j<M-1&&vec.at(i).at(j+1)=='#'){
          count+=1;
        }
        if(i>0&&j>0&&vec.at(i-1).at(j-1)=='#'){
          count+=1;
        }
        if(i>0&&j<M-1 &&vec.at(i-1).at(j+1)=='#'){
          count+=1;
        }
        if(i<N-1&&j>0&&vec.at(i+1).at(j-1)=='#'){
          count+=1;
        }
        if(i<N-1&&j<M-1 &&vec.at(i+1).at(j+1)=='#'){
          count+=1;
        }
        string s;
        s = std::to_string(count);
        vec.at(i).at(j) = s;
      }
    }
  }
  for(int i = 0;i<N;i++){
  cout << vec.at(i) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:27: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
   41 |         vec.at(i).at(j) = s;
      |                           ^
      |                           |
      |                           std::string {aka std::__cxx11::basic_string<char>}