Language: C++

#include <iostream>
using namespace std;

const char WHITE = '.';
const char BLACK = '#';
// とりあえず最大サイズで解答配列を用意
// Width, Height.
const int w = h = 100;
char [100][100];
void solve(int black, int white);
void answer();
int main()
{
	int a, b;
	cin >> a >> b;
	solve();
	answer();
	return 0;
}
void solve(int black, int white)
{
	// 配列を上半分黒、下半分白で初期化
	bool isBlask = true;
	for(int j = 0; j < h; j++){
		if(j == h/2) isBlack = false;
	for(int i = 0; i < w; i++){
		ans[i][j] = isBlack? BLACK: WHITE;
	}
	}
	// 黒と白は一つずつ島があるからそれを引く
	--black; --white;
	Loop: for(int j = 0; j < h; j+=2){
	for(int i = 0; i < w; i+=2){
		if(black | white) break Loop;
		// 白い島の中に点々と黒い孤島を置いていく
		if(black--){
			ans[i][h-j] = black;
		}
		// 黒い島の中に点々と白い孤島を置いていく
		if(white--){
			ans[i][j] = white;
		}
	}
	}
}
void answer()
{
	cout << w << " " << h << endl;
	for(int j = 0; j < h; j++){
	for(int i = 0; i < w; i++){
		cout << ans[i][j];
	}
		cout << endl;
	}
}

Compiler output:
a.cc:8:15: error: 'h' was not declared in this scope
    8 | const int w = h = 100;
      |               ^
a.cc:9:7: error: expected identifier before numeric constant
    9 | char [100][100];
      |       ^~~
a.cc:9:7: error: expected ']' before numeric constant
    9 | char [100][100];
      |       ^~~
      |       ]
a.cc:9:6: error: structured binding declaration cannot have type 'char'
    9 | char [100][100];
      |      ^
a.cc:9:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:9:6: error: empty structured binding declaration
a.cc:9:11: error: expected initializer before '[' token
    9 | char [100][100];
      |           ^
a.cc: In function 'int main()':
a.cc:16:14: error: too few arguments to function 'void solve(int, int)'
   16 |         solve();
      |         ~~~~~^~
a.cc:10:6: note: declared here
   10 | void solve(int black, int white);
      |      ^~~~~
a.cc: In function 'void solve(int, int)':
a.cc:24:28: error: 'h' was not declared in this scope
   24 |         for(int j = 0; j < h; j++){
      |                            ^
a.cc:25:30: error: 'isBlack' was not declared in this scope; did you mean 'isBlask'?
   25 |                 if(j == h/2) isBlack = false;
      |                              ^~~~~~~
      |                              isBlask
a.cc:27:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |                 ans[i][j] = isBlack? BLACK: WHITE;
      |                 ^~~
      |                 abs
a.cc:27:29: error: 'isBlack' was not declared in this scope; did you mean 'isBlask'?
   27 |                 ans[i][j] = isBlack? BLACK: WHITE;
      |                             ^~~~~~~
      |                             isBlask
a.cc:32:34: error: 'h' was not declared in this scope
   32 |         Loop: for(int j = 0; j < h; j+=2){
      |                                  ^
a.cc:34:40: error: expected ';' before 'Loop'
   34 |                 if(black | white) break Loop;
      |                                        ^~~~~
      |                                        ;
a.cc:34:41: error: 'Loop' was not declared in this scope
   34 |                 if(black | white) break Loop;
      |                                         ^~~~
a.cc:37:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   37 |                         ans[i][h-j] = black;
      |                         ^~~
      |                         abs
a.cc:41:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   41 |                         ans[i][j] = white;
      |                         ^~~
      |                         abs
a.cc: In function 'void answer()':
a.cc:48:29: error: 'h' was not declared in this scope
   48 |         cout << w << " " << h << endl;
      |                             ^
a.cc:51:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   51 |                 cout << ans[i][j];
      |                         ^~~
      |                         abs