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

#include <iostream>
#include <string>
using namespace std;

    
int main() {
  int H, W;
  cin >> H >> W;
  char S[H][W];
  int intS[H][W];
  for (int i=0; i < H; ++i) {
    for (int j=0; j < W; ++j) {
      cin >> S[i][j];
      if (S[i][j] == '.') {
        intS[i][j] = 0;
      }
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int m=0; m < H; ++m) {
    for (int n=0; n < W; ++n) {
      if (S[m][n] == "#") {
        continue;
      }
      else {
        int countBomb = 0;
        for (int i=0; i < 8; ++i) {
          int deltaM = m + deltaArrayM[i];
          int deltaN = n + deltaArrayN[i];
          if ((deltaM < 0) || (deltaM > H) || (deltaN < 0) || (deltaN > W)) {
            continue;
          }
          else {
            if (S[deltaM][deltaN] == "#") {
              ++countBomb;
            }
          }
        }
        intS[m][n] = countBomb;
      }
    }
  }
  for (int i=0; i < H; ++i) {
    for (int j=0; j < W; ++j) {
      if (S[i][j] == "#") {
        cout << "#";
      else {
        cout << intS[i][j];
      }
    }
    cout << "\n";
    }      
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |       if (S[m][n] == "#") {
      |           ~~~~~~~~^~~~~~
a.cc:35:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   35 |             if (S[deltaM][deltaN] == "#") {
      |                 ~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:46:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   46 |       if (S[i][j] == "#") {
      |           ~~~~~~~~^~~~~~
a.cc:48:7: error: expected '}' before 'else'
   48 |       else {
      |       ^~~~
a.cc:46:27: note: to match this '{'
   46 |       if (S[i][j] == "#") {
      |                           ^
a.cc: At global scope:
a.cc:55:1: error: expected declaration before '}' token
   55 | }
      | ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

    
int main() {
  int H, W;
  cin >> H >> W;
  char S[H][W];
  for (int i=0; i < H; ++i) {
    for (int j=0; j < W; ++j) {
      cin >> S[i][j];
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int m=0; m < H; ++m) {
    for (int n=0; n < W; ++n) {
      if (S[m][n] == "#") {
        continue;
      }
      else {
        int countBomb = 0;
        for (int i=0; i < 8; ++i) {
          int deltaM = m + deltaArrayM[i];
          int deltaN = n + deltaArrayN[i];
          if ((deltaM < 0) || (deltaM > H) || (deltaN < 0) || (deltaN > W))) {
            continue;
          }
          else {
            if (S[deltaM][deltaN] == "#") {
              ++countBomb;
            }
          }
        }
        S[m][n] = countBomb;
      }
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |       if (S[m][n] == "#") {
      |           ~~~~~~~~^~~~~~
a.cc:27:76: error: expected primary-expression before ')' token
   27 |           if ((deltaM < 0) || (deltaM > H) || (deltaN < 0) || (deltaN > W))) {
      |                                                                            ^
a.cc:31:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   31 |             if (S[deltaM][deltaN] == "#") {
      |                 ~~~~~~~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

    
int main() {
  int H, W;
  cin >> H >> W;
  char S[H][W];
  for (int i=0; i < H; ++i) {
    for (int j=0; j < W; ++j) {
      cin >> S[i][j];
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int m=0; m < H; ++m) {
    for (int n=0; n < W; ++n) {
      if (S[m][n] == "#") {
        continue;
      }
      else {
        int countBomb = 0;
        for (int i=0; i < 8; ++i) {
          int deltaM = m + deltaArrayM[i];
          int deltaN = n + deltaArrayN[i];
          if ((deltaM < 0) || (deltaM > H)) {
            continue;
          }
          else if ((deltaN < 0) || (deltaN > W)) {
            continue;
          }
          else {
            if (S[deltaM][deltaN] == "#") {
              ++countBomb;
            }
          }
        }
        S[m][n] = countBomb;
      }
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |       if (S[m][n] == "#") {
      |           ~~~~~~~~^~~~~~
a.cc:34:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   34 |             if (S[deltaM][deltaN] == "#") {
      |                 ~~~~~~~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

    
int main() {
  int H, W;
  cin >> H >> W;
  string line;
  cin.ignore();
  char S[H][W];
  for (int i=0; i < H; ++i) {
    getline(cin, line);
    for (int j=0; j < W; ++j) {
      cin >> S[i][j];
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int m=0; m < H; ++m) {
    for (int n=0; n < W; ++n) {
      if (S[m][n] == "#") {
        continue;
      }
      else {
        int countBomb = 0;
        for (int i=0; i < 8; ++i) {
          int deltaM = m + deltaArrayM[i];
          int deltaN = n + deltaArrayN[i];
          if ((deltaM < 0) || (deltaM > H)) {
            continue;
          }
          else if ((deltaN < 0) || (deltaN > W)) {
            continue;
          }
          else {
            if (S[deltaM][deltaN] == "#") {
              ++countBomb;
            }
          }
        }
        S[m][n] = countBomb;
      }
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |       if (S[m][n] == "#") {
      |           ~~~~~~~~^~~~~~
a.cc:37:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   37 |             if (S[deltaM][deltaN] == "#") {
      |                 ~~~~~~~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

    
int main() {
  int H, W;
  cin >> H >> W;
  srting line;
  cin.ignore();
  char S[H][W];
  for (int i=0; i < H; ++i) {
    getline(cin, line);
    for (int j=0; j < W; ++j) {
      cin >> S[i][j];
    }
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int m=0; m < H; ++m) {
    for (int n=0; n < W; ++n) {
      if (S[m][n] == "#") {
        continue;
      }
      else {
        int countBomb = 0;
        for (int i=0; i < 8; ++i) {
          int deltaM = m + deltaArrayM[i];
          int deltaN = n + deltaArrayN[i];
          if ((deltaM < 0) || (deltaM > H)) {
            continue;
          }
          else if ((deltaN < 0) || (deltaN > W)) {
            continue;
          }
          else {
            if (S[deltaM][deltaN] == "#") {
              ++countBomb;
            }
          }
        }
        S[m][n] = countBomb;
      }
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'srting' was not declared in this scope
    9 |   srting line;
      |   ^~~~~~
a.cc:13:18: error: 'line' was not declared in this scope
   13 |     getline(cin, line);
      |                  ^~~~
a.cc:22:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |       if (S[m][n] == "#") {
      |           ~~~~~~~~^~~~~~
a.cc:37:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   37 |             if (S[deltaM][deltaN] == "#") {
      |                 ~~~~~~~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

    
int main() {
  int H, W;
  cin >> H >> W;
  string S[H][W];
  for (int i=0; i < H; ++i) {
    cin >> S[i][];
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int m=0; m < H; ++m) {
    for (int n=0; n < W; ++n) {
      if (S[m][n] == "#") {
        continue;
      }
      else {
        int countBomb = 0;
        for (int i=0; i < 8; ++i) {
          int deltaM = m + deltaArrayM[i];
          int deltaN = n + deltaArrayN[i];
          if ((deltaM < 0) || (deltaM > H)) {
            continue;
          }
          else if ((deltaN < 0) || (deltaN > W)) {
            continue;
          }
          else {
            if (S[deltaM][deltaN] == "#") {
              ++countBomb;
            }
          }
        }
        S[m][n] = countBomb;
      }
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: expected primary-expression before ']' token
   11 |     cin >> S[i][];
      |                 ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

    
int main() {
  int H, W;
  cin >> H >> W;
  string S[H];
  for (int i=0; i < H; ++i) {
    cin >> S[i];
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int m=0; m < H; ++m) {
    for (int n=0; n < W; ++n) {
      if (S[m][n] == "#") {
        continue;
      }
      else {
        int countBomb = 0;
        for (int i=0; i < 8; ++i) {
          int deltaM = m + deltaArrayM[i];
          int deltaN = n + deltaArrayN[i];
          if ((deltaM < 0) || (deltaM > H)) {
            continue;
          }
          else if ((deltaN < 0) || (deltaN > W)) {
            continue;
          }
          else {
            if (S[deltaM][deltaN] == "#") {
              ++countBomb;
            }
          }
        }
        S[m][n] = countBomb;
      }
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |       if (S[m][n] == "#") {
a.cc:32:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |             if (S[deltaM][deltaN] == "#") {
Language: C++

#include <iostream>
#include <string>
using namespace std;

    
int main() {
  int H, W;
  cin >> H >> W;
  string S[H];
  for (int i=0; i < H; ++i) {
    cin >> S[i];
  }
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int m=0; m < H; ++i) {
    for (int n=0; n < W; ++j) {
      if (S[m][n] == "#") {
        continue;
      }
      else {
        int countBomb = 0;
        for (int i=0; i < 8; ++i) {
          int deltaM = m + deltaArrayM[i];
          int deltaN = n + deltaArrayN[i];
          if ((deltaM < 0) || (deltaM > H)) {
            continue;
          }
          else if ((deltaN < 0) || (deltaN > W)) {
            continue;
          }
          else {
            if (S[deltaM][deltaN] == "#") {
              ++countBomb;
            }
          }
        }
        S[m][n] = countBomb;
      }
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: 'i' was not declared in this scope
   15 |   for (int m=0; m < H; ++i) {
      |                          ^
a.cc:16:28: error: 'j' was not declared in this scope
   16 |     for (int n=0; n < W; ++j) {
      |                            ^
a.cc:17:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |       if (S[m][n] == "#") {
a.cc:32:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |             if (S[deltaM][deltaN] == "#") {
Language: C++

#include <iostream>
#include <string>
using namespace std;

void searchBomb(string (*grid)[], int m, int n, int maxH, int maxW) {
  int countBomb = 0;
  int deltaArrayM[8] = {1,0,-1,0,1,-1,1,-1};
  int deltaArrayN[8] = {0,1,0,-1,1,-1,-1,1};
  for (int i=0; i < 8; ++i) {
    int deltaM = m + deltaArrayM[i];
    int deltaN = n + deltaArrayN[i];
    if ((deltaM < 0) || (deltaM > maxH)) {
      continue;
    }
    else if ((deltaN < 0) || (deltaN > maxW)) {
      continue;
    }
    else {
      if (grid[deltaM][deltaN] == "#") {
        ++countBomb;
      }
    }
  }
  grid[m][n] = countBomb;
}
      
    
int main() {
  int H, W;
  cin >> H >> W;
  string S[H];
  for (int i=0; i < H; ++i) {
    cin >> S[i];
  }
  for (int i=0; i < H; ++i) {
    for (int j=0; j < W; ++j) {
      if (grid[m][n] == "#") {
        continue;
      }
      else {
        searchBomb(S, i, j, H, W);
      }
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'void searchBomb(std::string (*)[], int, int, int, int)':
a.cc:19:22: error: invalid use of array with unspecified bounds
   19 |       if (grid[deltaM][deltaN] == "#") {
      |                      ^
a.cc:24:9: error: invalid use of array with unspecified bounds
   24 |   grid[m][n] = countBomb;
      |         ^
a.cc: In function 'int main()':
a.cc:37:11: error: 'grid' was not declared in this scope
   37 |       if (grid[m][n] == "#") {
      |           ^~~~
a.cc:37:16: error: 'm' was not declared in this scope
   37 |       if (grid[m][n] == "#") {
      |                ^
a.cc:37:19: error: 'n' was not declared in this scope
   37 |       if (grid[m][n] == "#") {
      |                   ^
a.cc:41:20: error: cannot convert 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::string (*)[]' {aka 'std::__cxx11::basic_string<char> (*)[]'}
   41 |         searchBomb(S, i, j, H, W);
      |                    ^
      |                    |
      |                    std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:5:26: note:   initializing argument 1 of 'void searchBomb(std::string (*)[], int, int, int, int)'
    5 | void searchBomb(string (*grid)[], int m, int n, int maxH, int maxW) {
      |                 ~~~~~~~~~^~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

void searchBomb(string *(grid)[], int m, int n, int maxH, int maxW) {
  int countBomb = 0;
  int deltaArrayM[4] = {1,0,-1,0};
  int deltaArrayN[4] = {0,1,0,-1};
  for (int i=0; i < 4; ++i) {
    int deltaM = m + deltaArrayM[i];
    int deltaN = n + deltaArrayN[i];
    if ((deltaM < 0) || (deltaM > maxH)) {
      continue;
    }
    else if ((deltaN < 0) || (deltaN > maxW)) {
      continue;
    }
    else {
      if (grid[deltaM][deltaN] == "#") {
        ++countBomb;
      }
    }
  }
  grid[m][n] = countBomb;
}
      
    
int main() {
  int H, W;
  cin >> H >> W;
  string S[H];
  for (int i=0; i < H; ++i) {
    cin >> S[i];
  }
  for (int i=0; i < H; ++i) {
    for (int j=0; j < W; ++j) {
      if (grid[m][n] == "#") {
        continue;
      }
      else {
        searchBomb(S, i, j, H, W);
      }
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:37:11: error: 'grid' was not declared in this scope
   37 |       if (grid[m][n] == "#") {
      |           ^~~~
a.cc:37:16: error: 'm' was not declared in this scope
   37 |       if (grid[m][n] == "#") {
      |                ^
a.cc:37:19: error: 'n' was not declared in this scope
   37 |       if (grid[m][n] == "#") {
      |                   ^
a.cc:41:20: error: cannot convert 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::string**' {aka 'std::__cxx11::basic_string<char>**'}
   41 |         searchBomb(S, i, j, H, W);
      |                    ^
      |                    |
      |                    std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:5:26: note:   initializing argument 1 of 'void searchBomb(std::string**, int, int, int, int)'
    5 | void searchBomb(string *(grid)[], int m, int n, int maxH, int maxW) {
      |                 ~~~~~~~~~^~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

int searchBomb(string *(grid)[], int m, int n, int maxH, int maxW) {
  if (grid[m][n] == "#") {
    return 0;
  }
  int countBomb = 0;
  int deltaArrayM[4] = {1,0,-1,0};
  int deltaArrayN[4] = {0,1,0,-1};
  for (int i=0; i < 4; ++i) {
    deltaM = m + deltaArrayM[i];
    deltaN = n + deltaArrayN[i];
    if ((deltaM < 0) || (deltaM > maxH)) {
      continue;
    }
    else if ((deltaN < 0) || (deltaN > maxW)) {
      continue;
    }
    else {
      if (grid[deltaM][deltaN] == "#") {
        ++countBomb;
      }
    }
  }
  grid[m][n] = countBomb;
}
      
    
int main() {
  int H, W;
  cin >> H >> W;
  string S[H];
  for (int i=0; i < H; ++i) {
    cin >> S[i];
  }
  for (int i=0; i < H; ++i) {
    for (int j=0; j < W; ++j) {
      searchBomb(S, i, j, H, W);
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int searchBomb(std::string**, int, int, int, int)':
a.cc:13:5: error: 'deltaM' was not declared in this scope
   13 |     deltaM = m + deltaArrayM[i];
      |     ^~~~~~
a.cc:14:5: error: 'deltaN' was not declared in this scope
   14 |     deltaN = n + deltaArrayN[i];
      |     ^~~~~~
a.cc: In function 'int main()':
a.cc:40:18: error: cannot convert 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::string**' {aka 'std::__cxx11::basic_string<char>**'}
   40 |       searchBomb(S, i, j, H, W);
      |                  ^
      |                  |
      |                  std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:5:25: note:   initializing argument 1 of 'int searchBomb(std::string**, int, int, int, int)'
    5 | int searchBomb(string *(grid)[], int m, int n, int maxH, int maxW) {
      |                ~~~~~~~~~^~~~~~~
a.cc: In function 'int searchBomb(std::string**, int, int, int, int)':
a.cc:28:1: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      | ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int searchBomb(string *(grid)[], int m, int n, int maxH, int maxW) {
  if (grid[m][n] == "#") {
    return 0;
  }
  int countBomb = 0;
  deltaArrayM[4] = {1,0,-1,0};
  deltaArrayN[4] = {0,1,0,-1};
  for (int i=0; i < 4; ++i) {
    deltaM = m + deltaArrayM[i];
    deltaN = n + deltaArrayN[i];
    if ((deltaM < 0) || (deltaM > maxH)) {
      continue;
    }
    else if ((deltaN < 0) || (deltaN > maxW)) {
      continue;
    }
    else {
      if (grid[deltaM][deltaN] == "#") {
        ++countBomb;
      }
    }
  }
  grid[m][n] = countBomb;
}
      
    
int main() {
  int H, W;
  cin >> H >> W;
  string S[H];
  for (int i=0; i < H; ++i) {
    cin >> S[i];
  }
  for (int i=0; i < H; ++i) {
    for (int j=0; j < W; ++j) {
      searchBomb(S, i, j, H, W);
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'int searchBomb(std::string**, int, int, int, int)':
a.cc:10:3: error: 'deltaArrayM' was not declared in this scope
   10 |   deltaArrayM[4] = {1,0,-1,0};
      |   ^~~~~~~~~~~
a.cc:11:3: error: 'deltaArrayN' was not declared in this scope
   11 |   deltaArrayN[4] = {0,1,0,-1};
      |   ^~~~~~~~~~~
a.cc:13:5: error: 'deltaM' was not declared in this scope
   13 |     deltaM = m + deltaArrayM[i];
      |     ^~~~~~
a.cc:14:5: error: 'deltaN' was not declared in this scope
   14 |     deltaN = n + deltaArrayN[i];
      |     ^~~~~~
a.cc: In function 'int main()':
a.cc:40:18: error: cannot convert 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::string**' {aka 'std::__cxx11::basic_string<char>**'}
   40 |       searchBomb(S, i, j, H, W);
      |                  ^
      |                  |
      |                  std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:5:25: note:   initializing argument 1 of 'int searchBomb(std::string**, int, int, int, int)'
    5 | int searchBomb(string *(grid)[], int m, int n, int maxH, int maxW) {
      |                ~~~~~~~~~^~~~~~~
a.cc: In function 'int searchBomb(std::string**, int, int, int, int)':
a.cc:27:16: warning: control reaches end of non-void function [-Wreturn-type]
   27 |   grid[m][n] = countBomb;
      |                ^~~~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

void searchBomb(string *(grid)[], int m, int n, int maxH, int maxW) {
  if (grid[m][n] == "#") {
    break;
  }
  countBomb = 0;
  deltaArrayM[4] = {1,0,-1,0};
  deltaArrayN[4] = {0,1,0,-1};
  for (int i=0; i < 4; ++i) {
    deltaM = m + deltaArrayM[i];
    deltaN = n + deltaArrayN[i];
    if ((deltaM < 0) || (deltaM > maxH)) {
      continue;
    }
    else if ((deltaN < 0) || (deltaN > maxW)) {
      continue;
    }
    else {
      if (grid[deltaM][deltaN] == "#") {
        ++countBomb;
      }
    }
  }
  grid[m][n] = countBomb;
}
      
    
int main() {
  int H, W;
  cin >> H >> W;
  string S[H];
  for (int i=0; i < H; ++i) {
    cin >> S[i];
  }
  for (int i=0; i < H; ++i) {
    for (int j=0; j < W; ++j) {
      searchBomb(S, i, j, H, W);
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc: In function 'void searchBomb(std::string**, int, int, int, int)':
a.cc:7:5: error: break statement not within loop or switch
    7 |     break;
      |     ^~~~~
a.cc:9:3: error: 'countBomb' was not declared in this scope
    9 |   countBomb = 0;
      |   ^~~~~~~~~
a.cc:10:3: error: 'deltaArrayM' was not declared in this scope
   10 |   deltaArrayM[4] = {1,0,-1,0};
      |   ^~~~~~~~~~~
a.cc:11:3: error: 'deltaArrayN' was not declared in this scope
   11 |   deltaArrayN[4] = {0,1,0,-1};
      |   ^~~~~~~~~~~
a.cc:13:5: error: 'deltaM' was not declared in this scope
   13 |     deltaM = m + deltaArrayM[i];
      |     ^~~~~~
a.cc:14:5: error: 'deltaN' was not declared in this scope
   14 |     deltaN = n + deltaArrayN[i];
      |     ^~~~~~
a.cc: In function 'int main()':
a.cc:40:18: error: cannot convert 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::string**' {aka 'std::__cxx11::basic_string<char>**'}
   40 |       searchBomb(S, i, j, H, W);
      |                  ^
      |                  |
      |                  std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:5:26: note:   initializing argument 1 of 'void searchBomb(std::string**, int, int, int, int)'
    5 | void searchBomb(string *(grid)[], int m, int n, int maxH, int maxW) {
      |                 ~~~~~~~~~^~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

void searchBomb(string *(grid)[]; int m; int n, int maxH, int maxW) {
  if (grid[m][n] == "#") {
    break;
  }
  countBomb = 0;
  deltaArrayM[4] = {1,0,-1,0};
  deltaArrayN[4] = {0,1,0,-1};
  for (int i=0; i < 4; ++i) {
    deltaM = m + deltaArrayM[i];
    deltaN = n + deltaArrayN[i];
    if ((deltaM < 0) || (deltaM > maxH)) {
      continue;
    }
    else if ((deltaN < 0) || (deltaN > maxW)) {
      continue;
    }
    else {
      if (grid[deltaM][deltaN] == "#") {
        ++countBomb;
      }
    }
  }
  grid[m][n] = countBomb;
}
      
    
int main() {
  int H, W;
  cin >> H >> W;
  string S[H];
  for (int i=0; i < H; ++i) {
    cin >> S[i];
  }
  for (int i=0; i < H; ++i) {
    for (int j=0; j < W; ++j) {
      searchBomb(S, i, j, H, W);
    }
  }
  for (int i=0; i < H; ++i) {
    cout << S[i] << "\n";
  }
}
  
  

Compiler output:
a.cc:5:33: error: expected ')' before ';' token
    5 | void searchBomb(string *(grid)[]; int m; int n, int maxH, int maxW) {
      |                ~                ^
      |                                 )
a.cc:5:49: error: expected unqualified-id before 'int'
    5 | void searchBomb(string *(grid)[]; int m; int n, int maxH, int maxW) {
      |                                                 ^~~
a.cc: In function 'int main()':
a.cc:40:18: error: cannot convert 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'std::string**' {aka 'std::__cxx11::basic_string<char>**'}
   40 |       searchBomb(S, i, j, H, W);
      |                  ^
      |                  |
      |                  std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:5:26: note:   initializing argument 1 of 'void searchBomb(std::string**)'
    5 | void searchBomb(string *(grid)[]; int m; int n, int maxH, int maxW) {
      |                 ~~~~~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];
typedef long long int ll;
using namespace std;

int main(){
	int h,w; cin >> h >> w;
	string s[60];
	int dh[]={-1,-1,-1,0,0,1,1,1};
	int dw[]={-1,0,1,-1,1,-1,0,1};

	for(int i=0;i<h;i++) 
		cin >> s[i];
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(s[i][j]=='.'){
				int cnt=0;
				for(int k=0;k<8;k++){
					int x = j +de[k];
					int y = i +dh[k];
					if(0<=x && x<=w && 0 <=y && y <=h && s[y[x]]=='#') cnt++;
				}
				s[i][j]= '0'+cnt;
			}
		}
	}
	for(int i=0;i<h;i++){
		cout << s[i]<< endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:52: error: 'de' was not declared in this scope; did you mean 'dw'?
   19 |                                         int x = j +de[k];
      |                                                    ^~
      |                                                    dw
a.cc:21:81: error: invalid types 'int[int]' for array subscript
   21 |                                         if(0<=x && x<=w && 0 <=y && y <=h && s[y[x]]=='#') cnt++;
      |                                                                                 ^
Language: C++

#include <bits/stdc++.h>
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];
typedef long long int ll;
using namespace std;

int main(){
	int h,w; cin >> h >> w;
	string s[60];
	int dh[]={-1,-1,-1,0,0,1,1,1};
	int dw[]={-1,0,1,-1,1,-1,0,1};

	for(int i=0;i<h;i++) 
		cin >> s[i];
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(s[i][j]=='.'){
				int cnt=0;
				for(int K-0;k<8;k++){
					int x = j +de[k];
					int y = i +dh[k];
					if(0<=x && x<=w && 0 <=y && y <=h && s[y[x]]=='#') cnt++;
				}
				s[i][j]= '0'+cnt;
			}
		}
	}
	for(int i=0;i<h;i++){
		cout << s[i]<< endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:42: error: expected ';' before '-' token
   18 |                                 for(int K-0;k<8;k++){
      |                                          ^
      |                                          ;
a.cc:18:45: error: 'k' was not declared in this scope
   18 |                                 for(int K-0;k<8;k++){
      |                                             ^
a.cc:18:48: error: expected ')' before ';' token
   18 |                                 for(int K-0;k<8;k++){
      |                                    ~           ^
      |                                                )
a.cc:18:49: error: 'k' was not declared in this scope
   18 |                                 for(int K-0;k<8;k++){
      |                                                 ^
Language: C++

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int h, w;
  cin >> h >> w;
  vector<int> board(h);
  REP(i, h) cin >> board[i];
  int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
  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++) {
        int ni = i + dy[d];
        int nj = i + dx[d];
        if(ni < 0 or h <= ni) continue;
        if(nj > 0 or w <= 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: In function 'int main()':
a.cc:18:18: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   18 |       if(board[i][j] == '#') continue;
      |                  ^
a.cc:25:21: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   25 |         if(board[ni][nj] == '#') num;
      |                     ^
a.cc:27:15: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   27 |       board[i][j] = char(num + '0');
      |               ^
Language: C++

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int h, w;
  cin >> h >> w;
  vector<int> board(h);
  REP(i, h) cin >> board[i];
  int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
  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++) {
        int ni = i + dy[d];
        int nj = i + dx[d];
        if(ni < 0 or h <= ni) continue;
        if(nj > 0 or w <= 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: In function 'int main()':
a.cc:18:18: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   18 |       if(board[i][j] == '#') continue;
      |                  ^
a.cc:25:21: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   25 |         if(board[ni][nj] == '#') num;
      |                     ^
a.cc:28:14: error: 'j' was not declared in this scope
   28 |     board[i][j] = char(num + '0');
      |              ^
a.cc:28:24: error: 'num' was not declared in this scope; did you mean 'enum'?
   28 |     board[i][j] = char(num + '0');
      |                        ^~~
      |                        enum
Language: C

#include<stdio.h>
int main(void){
	int h,w;
  scanf("%d %d",&h,&w);
	int i,j;
  char **a = malloc(sizeof(char *)*h);
  for(i=0;i<h,i++){
  	*a[i]=malloc(sizeof(char)*w);
  }
  for(i=0;i<h,i++)
  	scanf("%s",a[i]);
  int x[8]={1,1,1,0,-1,-1,-1,0};
  int y[8]={-1,0,1,1,1,0,-1,-1};
  int k,count=0;
  for(i=0;i<h;i++){
  	for(j=0;j<w;j++){
    	if(a[i][j]=='-'){
          count=0;
        	for(k=0;k<8;k++){
            	if(a[x[k]][y[k]]=='#')
                  count++;
            }	
          a[i][j]='0'+count;
        }
    }
  }
  for(i=0;i<h;i++){
  	printf("%s\n",a[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:14: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    6 |   char **a = malloc(sizeof(char *)*h);
      |              ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | int main(void){
main.c:6:14: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    6 |   char **a = malloc(sizeof(char *)*h);
      |              ^~~~~~
main.c:6:14: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:7:18: error: expected ';' before ')' token
    7 |   for(i=0;i<h,i++){
      |                  ^
      |                  ;
main.c:8:14: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
    8 |         *a[i]=malloc(sizeof(char)*w);
      |              ^
main.c:10:18: error: expected ';' before ')' token
   10 |   for(i=0;i<h,i++)
      |                  ^
      |                  ;
Language: C++

#include <iostream>
#include <string>
 
using namespace std;
 
int main()
{
  int H,W;
  cin >> H >> W;
  string S[H];
  for(int i = 0; i < H; ++i) cin >> S[i];
  int neig[8][2] = {{-1,-1},
		 {0,-1},
		 {1,-1},
		 {-1,0},
		 {1,0},
		 {-1,1},
		 {0,1},
		 {1,1}};
 
  int l = 1;
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      if(S[i][j]=='.'){
        int bombcount=0;
       	for(int z=0;z<8;++z){
          int y=i+neig[z][0];
          int x=j+neig[z][1];
          if(x>=0&&y>=0&&x<W&&y<H){
           	if(S[y][x]=='#'){
             	bombcount++; 
            }
          }
        }
        cout c= to_string(bombcount);
        S[i][j]=c[0];
      }
    }
  }
  for(int i = 0; i < H; ++i) cout<< S[i]<< '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: expected ';' before 'c'
   35 |         cout c= to_string(bombcount);
      |             ^~
      |             ;
a.cc:36:17: error: 'c' was not declared in this scope
   36 |         S[i][j]=c[0];
      |                 ^
Language: C++

#include <iostream>
#include <string>
 
using namespace std;
 
int main()
{
  int H,W;
  cin >> H >> W;
  string S[H];
  for(int i = 0; i < H; ++i) cin >> S[i];
  int neig[8][2] = {{-1,-1},
		 {0,-1},
		 {1,-1},
		 {-1,0},
		 {1,0},
		 {-1,1},
		 {0,1},
		 {1,1}};
 
  int l = 1;
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      if(S[i][j]=='.'){
        int bombcount=0;
       	for(int z=0;z<8;++z){
          int y=i+neig[z][0];
          int x=j+neig[z][1];
          if(x>=0&&y>=0&&x<W&&y<H){
           	if(S[y][x]=='#'){
             	bombcount++; 
            }
          }
        }
        const char* c= bombcount.data();
        S[i][j]=c;
      }
    }
  }
  for(int i = 0; i < H; ++i) cout<< S[i]<< '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:34: error: request for member 'data' in 'bombcount', which is of non-class type 'int'
   35 |         const char* c= bombcount.data();
      |                                  ^~~~
a.cc:36:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   36 |         S[i][j]=c;
      |                 ^
      |                 |
      |                 const char*
Language: C++

#include <iostream>
#include <string>
 
using namespace std;
 
int main()
{
  int H,W;
  cin >> H >> W;
  string S[H];
  for(int i = 0; i < H; ++i) cin >> S[i];
  int neig[8][2] = {{-1,-1},
		 {0,-1},
		 {1,-1},
		 {-1,0},
		 {1,0},
		 {-1,1},
		 {0,1},
		 {1,1}};
 
  int l = 1;
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      if(S[i][j]=='.'){
        int bombcount=0;
       	for(int z=0;z<8;++z){
          int y=i+neig[z][0];
          int x=j+neig[z][1];
          if(x>=0&&y>=0&&x<W&&y<H){
           	if(S[y][x]=='#'){
             	bombcount++; 
            }
          }
        }
        S[i][j]=to_string(bombcount);
      }
    }
  }
  for(int i = 0; i < H; ++i) cout<< S[i]<< '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:26: 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
   35 |         S[i][j]=to_string(bombcount);
      |                 ~~~~~~~~~^~~~~~~~~~~
      |                          |
      |                          std::string {aka std::__cxx11::basic_string<char>}
Language: C++

#include <iostream>
#include <string>
 
using namespace std;
 
int main()
{
  int H,W;
  cin >> H >> W;
  string S[H];
  int bombcount=0;
  for(int i = 0; i < H; ++i) cin >> S[i];
  int neig[8][2] = {{-1,-1},
		 {0,-1},
		 {1,-1},
		 {-1,0},
		 {1,0},
		 {-1,1},
		 {0,1},
		 {1,1}};
 
  int l = 1;
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      if(S[i][j]=='.'){
       	for(int z=0;z<8;++z){
          y=i+neig[z][0];
          x=j+neig[z][1];
          if(x>=0&&y>=0&&X<W&&Y<H){
           	if(S[y][x]=='#'){
             	bombcount++; 
            }
          }
        }
        S[i][j]=to_string(bombcount);
      }
    }
  }
  for(int i = 0; i < H; ++i) cout<< S[i]<< '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:11: error: 'y' was not declared in this scope
   27 |           y=i+neig[z][0];
      |           ^
a.cc:28:11: error: 'x' was not declared in this scope
   28 |           x=j+neig[z][1];
      |           ^
a.cc:29:26: error: 'X' was not declared in this scope
   29 |           if(x>=0&&y>=0&&X<W&&Y<H){
      |                          ^
a.cc:29:31: error: 'Y' was not declared in this scope
   29 |           if(x>=0&&y>=0&&X<W&&Y<H){
      |                               ^
a.cc:35:26: 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
   35 |         S[i][j]=to_string(bombcount);
      |                 ~~~~~~~~~^~~~~~~~~~~
      |                          |
      |                          std::string {aka std::__cxx11::basic_string<char>}
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int H, W;
  cin >> H >> W;
  
  string board[H];
  for (int i = 0; i < H; ++i)
    cin >> board[i];
  
  const int dx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
  const int dy[] = {-1, 0, 1, -1, 1, -1, 0, 1};
  
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (board[i][j] == '#')
        continue;
      
      int numBomb = 0;
      
      for (int d = 0; d < 8; ++d) {
        const int neighbor_i = i + dy;
        const int neighbor_j = j + dx;
        
        if (neighbor_i < 0 or neighbor_i >= H) continue;
        if (neighbor_j < 0 or neighbor_j >= W) continue;
        ++numBomb;
      }
      
      board[i][j] = char(numBomb + '0');
    }
  }
  
  for (int i = 0; i < H; ++i)
      cout << board[i];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:34: error: invalid conversion from 'const int*' to 'int' [-fpermissive]
   24 |         const int neighbor_i = i + dy;
      |                                ~~^~~~
      |                                  |
      |                                  const int*
a.cc:25:34: error: invalid conversion from 'const int*' to 'int' [-fpermissive]
   25 |         const int neighbor_j = j + dx;
      |                                ~~^~~~
      |                                  |
      |                                  const int*
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int H, W;
  cin >> H >> W;
  
  string board[H];
  for (int i = 0; i < H; ++i)
    cin >> board[i];
  
  const int dx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
  const int dy[] = {-1, 0, 1, -1, 1, -1, 0, 1};
  
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (board[i][j] == '#')
        continue;
      
      int numBomb = 0;
      
      for (int d = 0; d < 8; ++d) {
        int neighbor_i = i + dy;
        int neighbor_j = j + dx;
        
        if (neighbor_i < 0 or neighbor_i >= H) continue;
        if (neighbor_j < 0 or neighbor_j >= W) continue;
        ++numBomb;
      }
      
      board[i][j] = char(numBomb + '0');
    }
  }
  
  for (int i = 0; i < H; ++i)
      cout << board[i];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:28: error: invalid conversion from 'const int*' to 'int' [-fpermissive]
   24 |         int neighbor_i = i + dy;
      |                          ~~^~~~
      |                            |
      |                            const int*
a.cc:25:28: error: invalid conversion from 'const int*' to 'int' [-fpermissive]
   25 |         int neighbor_j = j + dx;
      |                          ~~^~~~
      |                            |
      |                            const int*
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int H, W;
  cin >> H >> W;
  
  string board[H];
  for (int i = 0; i < H; ++i)
    cin >> board[i];
  
  const int dx = {-1, -1, -1, 0, 0, 1, 1, 1};
  const int dy = {-1, 0, 1, -1, 1, -1, 0, 1};
  
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (board[i][j] == '#')
        continue;
      
      int numBomb = 0;
      
      for (int d = 0; d < 8; ++d) {
        int neighbor_i = i + dy;
        int neighbor_j = j + dx;
        
        if (neighbor_i < 0 or neighbor_i >= H) continue;
        if (neighbor_j < 0 or neighbor_j >= W) continue;
        ++numBomb;
      }
      
      board[i][j] = char(numBomb + '0');
    }
  }
  
  for (int i = 0; i < H; ++i)
      cout << board[i];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: scalar object 'dx' requires one element in initializer
   13 |   const int dx = {-1, -1, -1, 0, 0, 1, 1, 1};
      |             ^~
a.cc:14:13: error: scalar object 'dy' requires one element in initializer
   14 |   const int dy = {-1, 0, 1, -1, 1, -1, 0, 1};
      |             ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int SIZE=55;
const int dr[]={-1,-1,-1,0,0,1,1,1};
const int dc[]={-1,0,1,-1,1,-1,0,1};
int H,W;
char M[SIZE][SIZE];
int cannot(int x,int y){
	int sum=0,r,c;
	for(int i=0;i<8;i++){
		r=x+dr[i];
		c=y+dc[i];
		if(r>=0&&r<H&&c>=0&&c<W&&m[r][c]=='#')sum++;
	}
	return sum;
}
int main(){
	cin>>H>>W;
	for(int i=0;i<H;i++)cin>>M[i];
	for(int i=0;i<H;i++) ;
		for(int j=0;j<W;j++)
			if(M[i][j]=='.')M[i][j]='0'+count(i,j);
	for(int i=0;i<H;i++)cout<<M[i]<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int cannot(int, int)':
a.cc:13:42: error: 'm' was not declared in this scope
   13 |                 if(r>=0&&r<H&&c>=0&&c<W&&m[r][c]=='#')sum++;
      |                                          ^
a.cc: In function 'int main()':
a.cc:22:30: error: 'i' was not declared in this scope
   22 |                         if(M[i][j]=='.')M[i][j]='0'+count(i,j);
      |                              ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

int maxtime(int x){
  return (x + 9) / 10 * 10;
}
int remtime(int x){
  return maxtime(x) - x;
}
int main(){
  int a, b, c, d, e;
  cin >> a >> b >> c >>d >>e;
  int sum = maxtime(a) + maxtime(b) + maxtime(c) + maxtime(d) + maxtime(e) ;
  sum -= max({ retime(a), retime(b), retime(c), retime(d), retime(e)});
  cout << sum << endl;
  return;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'retime' was not declared in this scope; did you mean 'remtime'?
   15 |   sum -= max({ retime(a), retime(b), retime(c), retime(d), retime(e)});
      |                ^~~~~~
      |                remtime
a.cc:15:13: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   15 |   sum -= max({ retime(a), retime(b), retime(c), retime(d), retime(e)});
      |          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
a.cc:17:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   17 |   return;
      |   ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int H, W;
  cin >> H >> W;
  string board[60];
  const int dx[8] = {1, 1, 1, 0, -1, -1, -1, 0};
  const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};

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

  for(int i = 1; i < H + 1; ++i){
    for(int j = 0; j < W +1; ++j){
      if(board[i][j] == '#') continue;
      int sum = 0;
      for(int d = 0; d < 8; ++d){
        if( board[i+dx[d]][j+dy[d]] == '#') ++sum;
      }
      board[i][j] = char( sum + '0');
    }
  }

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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  int h,w;
  cin>>h>>w;
  int vx={1,1,0,-1,-1,-1,0,1};
  int vy={0,1,1,1,0,-1,-1,-1};
  vector<string> s(h),t(h,"");
  REP(i,h){
    cin>>s[i];
  }
  int px,py;
  int cnt=0;
  char c;
  REP(i,h){
    REP(j,w){
      if(s[i][j]=='#'){
        t[i] += '#';
        continue;
      }
      REP(k,8){
        px = i+vx[k];
        py = j+vy[k];
        if(0<=px && px<=h-1 && 0<=py && py<=w-1 && s[px][py]=='#'){
          cnt++;
        }
      }
      c = cnt + '0';
      t[i] += c;
      cnt = 0;
    }
    cout<<t[i]<<endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: scalar object 'vx' requires one element in initializer
    7 |   int vx={1,1,0,-1,-1,-1,0,1};
      |       ^~
a.cc:8:7: error: scalar object 'vy' requires one element in initializer
    8 |   int vy={0,1,1,1,0,-1,-1,-1};
      |       ^~
Language: C++

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

int H, W;

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

void update(vector<string>& S, int x, int y) {
    if (S[x][y] == '#') {
        return;
    }
    int ans = 0;
    for (int i = -1; i <= 1; ++i) {
        for (int j = -1; j <= 1; ++j) {
            int nx = i + x;
            int ny = j + y;
            if (nx >= 0 && nx < H && ny >= 0 && ny < W && S[nx][ny] == '#') {
                ++ans;
            }
        }
    }
    S[x][y] = char(ans + '0');
}

int main() {
    cin >> H >> W;
    vector<string> S(H);
    for (int i = 0; i < H; ++i) {
        cin >> S[i];
    }
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            update(S, i, j);
        }
    }
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            cout << S[i][j];
        }
        cout << endl;
    }
    return 0;
}

Compiler output:
a.cc:7:10: error: structured binding declaration cannot have type 'const int'
    7 | const int[] dx = {-1, 0, 1, 0};
      |          ^~
a.cc:7:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:7:10: error: empty structured binding declaration
a.cc:7:13: error: expected initializer before 'dx'
    7 | const int[] dx = {-1, 0, 1, 0};
      |             ^~
a.cc:8:10: error: structured binding declaration cannot have type 'const int'
    8 | const int[] dy = {0, 1, 0, -1};
      |          ^~
a.cc:8:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:8:10: error: empty structured binding declaration
a.cc:8:13: error: expected initializer before 'dy'
    8 | const int[] dy = {0, 1, 0, -1};
      |             ^~