Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  char c[500][500];
  cin>>h>>w;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
       cin>>c[i][j];
    }
  }
  char r[500][500];
  char b[500][500];
  for(int i=0;i<h;i++){
    if(i%2){
      for(int j=0;j<w-1;j++){
        r[i][j]=‘#’;
      }
      b[i][w-1]=‘#’;
    }else{
      for(int j=1;j<=w-1;j++){
        b[i][j]=‘#’;
      }
      r[i][0]=‘#’;
    }
  }
  for (int i=0;i<h;i++){
    for (int j=0;j<w;j++){
      if(c[i][j]==‘#’){
        r[i][j]=‘#’;
        b[i][j]=‘#’;
      }
    }
  }
  for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
        cout<<r[i][j];
      }
      cout<<endl;
  }
cout<<endl;
  for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
        cout<<b[i][j];
      }
      cout<<endl;
  }
  return 0;
}

Compiler output:
a.cc:17:17: error: extended character ‘ is not valid in an identifier
   17 |         r[i][j]=‘#’;
      |                 ^
a.cc:17:18: error: stray '#' in program
   17 |         r[i][j]=‘#’;
      |                  ^
a.cc:17:19: error: extended character ’ is not valid in an identifier
   17 |         r[i][j]=‘#’;
      |                   ^
a.cc:19:17: error: extended character ‘ is not valid in an identifier
   19 |       b[i][w-1]=‘#’;
      |                 ^
a.cc:19:18: error: stray '#' in program
   19 |       b[i][w-1]=‘#’;
      |                  ^
a.cc:19:19: error: extended character ’ is not valid in an identifier
   19 |       b[i][w-1]=‘#’;
      |                   ^
a.cc:22:17: error: extended character ‘ is not valid in an identifier
   22 |         b[i][j]=‘#’;
      |                 ^
a.cc:22:18: error: stray '#' in program
   22 |         b[i][j]=‘#’;
      |                  ^
a.cc:22:19: error: extended character ’ is not valid in an identifier
   22 |         b[i][j]=‘#’;
      |                   ^
a.cc:24:15: error: extended character ‘ is not valid in an identifier
   24 |       r[i][0]=‘#’;
      |               ^
a.cc:24:16: error: stray '#' in program
   24 |       r[i][0]=‘#’;
      |                ^
a.cc:24:17: error: extended character ’ is not valid in an identifier
   24 |       r[i][0]=‘#’;
      |                 ^
a.cc:29:19: error: extended character ‘ is not valid in an identifier
   29 |       if(c[i][j]==‘#’){
      |                   ^
a.cc:29:20: error: stray '#' in program
   29 |       if(c[i][j]==‘#’){
      |                    ^
a.cc:29:21: error: extended character ’ is not valid in an identifier
   29 |       if(c[i][j]==‘#’){
      |                     ^
a.cc:30:17: error: extended character ‘ is not valid in an identifier
   30 |         r[i][j]=‘#’;
      |                 ^
a.cc:30:18: error: stray '#' in program
   30 |         r[i][j]=‘#’;
      |                  ^
a.cc:30:19: error: extended character ’ is not valid in an identifier
   30 |         r[i][j]=‘#’;
      |                   ^
a.cc:31:17: error: extended character ‘ is not valid in an identifier
   31 |         b[i][j]=‘#’;
      |                 ^
a.cc:31:18: error: stray '#' in program
   31 |         b[i][j]=‘#’;
      |                  ^
a.cc:31:19: error: extended character ’ is not valid in an identifier
   31 |         b[i][j]=‘#’;
      |                   ^
a.cc: In function 'int main()':
a.cc:17:17: error: '\U00002018' was not declared in this scope
   17 |         r[i][j]=‘#’;
      |                 ^
a.cc:19:17: error: '\U00002018' was not declared in this scope
   19 |       b[i][w-1]=‘#’;
      |                 ^
a.cc:22:17: error: '\U00002018' was not declared in this scope
   22 |         b[i][j]=‘#’;
      |                 ^
a.cc:24:15: error: '\U00002018' was not declared in this scope
   24 |       r[i][0]=‘#’;
      |               ^
a.cc:29:19: error: '\U00002018' was not declared in this scope
   29 |       if(c[i][j]==‘#’){
      |                   ^
a.cc:29:20: error: expected ')' before '\U00002019'
   29 |       if(c[i][j]==‘#’){
      |         ~          ^~
      |                    )