Language: C++

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

string s[52];

int main(void){
  int h, w;
  cin >> h >> w;
  for(int j=0;j<=w+1;j++) s[0] += '.';
  for(int i=0;i<h;i++){
    cin >> s[i];
    s[i] = '.' + s[i] + '.';
  }
  s[h+1] = s[0];
  
  int dx[4] = {1, 0, -1, 0};
  int dy[4] = {0, 1, 0, -1};
  for(int i=1;i<=h;i++)for(int j=1;j<=w;j++){
    if (s[i][j]=='#'){
      bool ok = false;
      for(int k=0;k<4;k++){
        if (s[i+dy[k]][j+dx[k]]=='#') {ok = true; break;}
      }
      if (!ok){
        cout << "No" << endl; return 0;
      }
    }    
  }
  cout << "Yes" << endl; return 0;
}  

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
    2 | using namesapce std;
      |       ^~~~~~~~~
a.cc:4:1: error: 'string' does not name a type; did you mean 'stdin'?
    4 | string s[52];
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin >> h >> w;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:27: error: 's' was not declared in this scope
    9 |   for(int j=0;j<=w+1;j++) s[0] += '.';
      |                           ^
a.cc:11:12: error: 's' was not declared in this scope
   11 |     cin >> s[i];
      |            ^
a.cc:14:3: error: 's' was not declared in this scope
   14 |   s[h+1] = s[0];
      |   ^
a.cc:25:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |         cout << "No" << endl; return 0;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 |         cout << "No" << endl; return 0;
      |                         ^~~~
      |                         std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:29:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   29 |   cout << "Yes" << endl; return 0;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:29:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   29 |   cout << "Yes" << endl; return 0;
      |                    ^~~~
      |                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~