Language: C++

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
    int h,w;
    int flag = 0;
    char a[60][60];

    cin >> h >> w;
    FOR(int i,0,h){
        FOR(int j,0,w){
            a[i][j] = '.';
        }
    }
    FOR(int i,0,h){
        FOR(int j,0,w){
            cin >> a[i+1][j+1];
        }
    }
    FORQ(int i,0,h){
        FORQ(int j,0,w){
            if(a[i+1][j+1] == '#'){
                if(a[i-1][j] == '.' && a[i+1][j] == '. '&& a[i][j-1] == '.' && a[i][j+1] == '.'){
                    flag = 1;
                }
            }
        }
    }
    if(flag = 0)cout << "Yes";
    else cout << "No";
    return 0;
}


Compiler output:
a.cc:57:53: warning: multi-character character constant [-Wmultichar]
   57 |                 if(a[i-1][j] == '.' && a[i+1][j] == '. '&& a[i][j-1] == '.' && a[i][j+1] == '.'){
      |                                                     ^~~~
a.cc: In function 'int main()':
a.cc:22:24: error: two or more data types in declaration of 'i'
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                        ^~~
a.cc:44:5: note: in expansion of macro 'FOR'
   44 |     FOR(int i,0,h){
      |     ^~~
a.cc:22:35: error: expected initializer before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:44:5: note: in expansion of macro 'FOR'
   44 |     FOR(int i,0,h){
      |     ^~~
a.cc:22:35: error: expected ';' before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:44:5: note: in expansion of macro 'FOR'
   44 |     FOR(int i,0,h){
      |     ^~~
a.cc:22:35: error: expected primary-expression before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:44:5: note: in expansion of macro 'FOR'
   44 |     FOR(int i,0,h){
      |     ^~~
a.cc:22:39: error: expected ')' before ';' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                       ~               ^
a.cc:44:5: note: in expansion of macro 'FOR'
   44 |     FOR(int i,0,h){
      |     ^~~
a.cc:44:9: error: expected primary-expression before 'int'
   44 |     FOR(int i,0,h){
      |         ^~~
a.cc:22:42: note: in definition of macro 'FOR'
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                          ^
a.cc:22:24: error: two or more data types in declaration of 'i'
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                        ^~~
a.cc:49:5: note: in expansion of macro 'FOR'
   49 |     FOR(int i,0,h){
      |     ^~~
a.cc:22:35: error: expected initializer before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:49:5: note: in expansion of macro 'FOR'
   49 |     FOR(int i,0,h){
      |     ^~~
a.cc:22:35: error: expected ';' before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:49:5: note: in expansion of macro 'FOR'
   49 |     FOR(int i,0,h){
      |     ^~~
a.cc:22:35: error: expected primary-expression before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:49:5: note: in expansion of macro 'FOR'
   49 |     FOR(int i,0,h){
      |     ^~~
a.cc:22:39: error: expected ')' before ';' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                       ~               ^
a.cc:49:5: note: in expansion of macro 'FOR'
   49 |     FOR(int i,0,h){
      |     ^~~
a.cc:49:9: error: expected primary-expression before 'int'
   49 |     FOR(int i,0,h){
      |         ^~~
a.cc:22:42: note: in definition of macro 'FOR'
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                          ^
a.cc:23:25: error: two or more data types in declaration of 'i'
   23 | #define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
      |                         ^~~
a.cc:54:5: note: in expansion of macro 'FORQ'
   54 |     FORQ(int i,0,h){
      |     ^~~~
a.cc:23:36: error: expected initializer before '<=' token
   23 | #define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
      |                                    ^~
a.cc:54:5: note: in expansion of macro 'FORQ'
   54 |     FORQ(int i,0,h){
      |     ^~~~
a.cc:23:36: error: expected ';' before '<=' token
   23 | #define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
      |                                    ^~
a.cc:54:5: note: in expansion of macro 'FORQ'
   54 |     FORQ(int i,0,h){
      |     ^~~~
a.cc:23:36: error: expected primary-expression before '<=' token
   23 | #define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
      |                                    ^~
a.cc:54:5: note: in expansion of macro 'FORQ'
   54 |     FORQ(int i,0,h){
      |     ^~~~
a.cc:23:41: error: expected ')' before ';' token
   23 | #define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
      |                        ~                ^
a.cc:54:5: note: in expansion of macro 'FORQ'
   54 |     FORQ(int i,0,h){
      |     ^~~~
a.cc:54:10: error: expected primary-expression before 'int'
   54 |     FORQ(int i,0,h){
      |          ^~~
a.cc:23:44: note: in definition of macro 'FORQ'
   23 | #define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
      |                                            ^