I have a problem: Given a chess-board n*n (the user inputs n). In the chess -board there are k black queens and k white queens (requirement: 2 queens with different color cannot beat each other. We don't care about 2 queens with the same color). Find k max?

PHP Code:
#include <iostream>

using namespace std;

struct Square
{
    
char Queen;
    
int BlackEnemies;
    
int WhiteEnemies;
};

void AllocBoard(Square ** & boardint n);

void DelBoard(Square ** & boardint n);

void ShowBoard(Square ** boardint n); 

void AddEnemies(Square ** & boardint nchar chess_pieceint rowint column);

void ReduceEnemies(Square ** & boardint nchar chess_pieceint rowint column);

int ArrangeQueen(Square ** & boardint nint blackint white);

void Release(Square ** & boardint nint blackint whiteint max);

int main()
{
    
Square ** board;
    
int nmax;
    
    
AllocBoard(boardn);

    
max ArrangeQueen(boardn00);

    
cout << "kmax is: " << max;
    
cout << endl;

    
Release(boardn00max);
    
    
DelBoard(boardn);

    return 
0;
}

void AllocBoard(Square ** & boardint n)
{
    
cout << "Enter the size of the chess-board: ";
    
cin >> n;

    
// Allocate
    
board = new Square * [n];
    for (
int i 0n; ++i)
    {
        
board[i] = new Square [n];
    }

    
// Initialize
    
for (int i 0n; ++i)
    {
        for (
int j 0n; ++j)
        {
            
board[i][j].Queen '*';
            
board[i][j].WhiteEnemies 0
            
board[i][j].BlackEnemies 0;
        }
    }
}

void DelBoard(Square ** & boardint n)
{
    for (
int i 0n; ++i)
    {
        
delete [] board[i];
    }

    
delete [] board;
}

void ShowBoard(Square ** boardint n)
{
    for (
int i 0n; ++i)
    {
        for (
int j 0n; ++j)
        {
            
cout << board[i][j].Queen << " ";
        }

        
cout << endl;
    }
}

void AddEnemies(Square ** & boardint nchar chess_pieceint rowint column)
{
    for (
int i 0n; ++i)
    {
        for (
int j 0n; ++j)
        {
            if (
row == || column == || row column == || row column == j)
            {
                if (
'W' == chess_piece)
                {
                    ++
board[i][j].WhiteEnemies;
                }
                else
                {
                    ++
board[i][j].BlackEnemies;
                }
            }
        }
    }
}

void ReduceEnemies(Square ** & boardint nchar chess_pieceint rowint column)
{
    for (
int i 0n; ++i)
    {
        for (
int j 0n; ++j)
        {
            if (
row == || column == || row column == || row column == j)
            {
                if (
'W' == chess_piece)
                {
                    --
board[i][j].WhiteEnemies;
                }
                else
                {
                    --
board[i][j].BlackEnemies;
                }
            }
        }
    }
}

int ArrangeQueen(Square ** & boardint nint blackint white)
{
    static 
int max 0;

    if (
black == white && max black)
    {
        
max black;
    }
    else
    {
        for (
int i 0n; ++i)
        {
            for (
int j 0n; ++j)
            {
                if (
== board[i][j].WhiteEnemies && '*' == board[i][j].Queen)
                {
                    
board[i][j].Queen 'B';
                    
AddEnemies(boardn'B'ij);
                    
ArrangeQueen(boardnblack 1white);
                    
ReduceEnemies(boardn'B'ij);
                    
board[i][j].Queen '*';
                }
                if (
== board[i][j].BlackEnemies && '*' == board[i][j].Queen)
                {
                    
board[i][j].Queen 'W';
                    
AddEnemies(boardn'W'ij);
                    
ArrangeQueen(boardnblackwhite 1);
                    
ReduceEnemies(boardn'W'ij);
                    
board[i][j].Queen '*';
                }
            }
        }
    }

    return 
        
max;
}

void Release(Square ** & boardint nint blackint whiteint max)
{
    if (
black == white && max == white)
    {
        
cout << endl;
        
ShowBoard(boardn);
        
cout << endl;
    }
    else
    {
        for (
int i 0n; ++i)
        {
            for (
int j 0n; ++j)
            {
                if (
== board[i][j].WhiteEnemies && '*' == board[i][j].Queen)
                {
                    
board[i][j].Queen 'B';
                    
AddEnemies(boardn'B'ij);
                    
ArrangeQueen(boardnblack 1white);
                    
ReduceEnemies(boardn'B'ij);
                    
board[i][j].Queen '*';
                }
                if (
== board[i][j].BlackEnemies && '*' == board[i][j].Queen)
                {
                    
board[i][j].Queen 'W';
                    
AddEnemies(boardn'W'ij);
                    
ArrangeQueen(boardnblackwhite 1);
                    
ReduceEnemies(boardn'W'ij);
                    
board[i][j].Queen '*';
                }
            }
        }
    }

Is this ok?