Language: C++

#include <iostream>

using namespace std;

int main(){
  char math[60][60];
  int H,W;

  cin >> H >> W;

  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      cin >> math[i][j];
    }
  }
  int s_check=0;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      char temp=math[i][j];
      if(temp=='#'){
        if((j+1)<W){if(temp!=math[i][j+1]) check++;} else check++;
        if((i+1)<H){if(temp!=math[i+1][j]) check++;} else check++;
        if((i-1)>0){if(temp!=math[i-1][j]) check++;} else check++;
        if((j-1)>0){if(temp!=math[i][j-1]) check++;} else check++;
        if(check==4){
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  cout << "Yes" <<endl;
  return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:21:44: error: 'check' was not declared in this scope; did you mean 's_check'?
   21 |         if((j+1)<W){if(temp!=math[i][j+1]) check++;} else check++;
      |                                            ^~~~~
      |                                            s_check
a.cc:21:59: error: 'check' was not declared in this scope; did you mean 's_check'?
   21 |         if((j+1)<W){if(temp!=math[i][j+1]) check++;} else check++;
      |                                                           ^~~~~
      |                                                           s_check
a.cc:22:44: error: 'check' was not declared in this scope; did you mean 's_check'?
   22 |         if((i+1)<H){if(temp!=math[i+1][j]) check++;} else check++;
      |                                            ^~~~~
      |                                            s_check
a.cc:22:59: error: 'check' was not declared in this scope; did you mean 's_check'?
   22 |         if((i+1)<H){if(temp!=math[i+1][j]) check++;} else check++;
      |                                                           ^~~~~
      |                                                           s_check
a.cc:23:44: error: 'check' was not declared in this scope; did you mean 's_check'?
   23 |         if((i-1)>0){if(temp!=math[i-1][j]) check++;} else check++;
      |                                            ^~~~~
      |                                            s_check
a.cc:23:59: error: 'check' was not declared in this scope; did you mean 's_check'?
   23 |         if((i-1)>0){if(temp!=math[i-1][j]) check++;} else check++;
      |                                                           ^~~~~
      |                                                           s_check
a.cc:24:44: error: 'check' was not declared in this scope; did you mean 's_check'?
   24 |         if((j-1)>0){if(temp!=math[i][j-1]) check++;} else check++;
      |                                            ^~~~~
      |                                            s_check
a.cc:24:59: error: 'check' was not declared in this scope; did you mean 's_check'?
   24 |         if((j-1)>0){if(temp!=math[i][j-1]) check++;} else check++;
      |                                                           ^~~~~
      |                                                           s_check
a.cc:25:12: error: 'check' was not declared in this scope; did you mean 's_check'?
   25 |         if(check==4){
      |            ^~~~~
      |            s_check