#include #include using namespace std; int main() { const char a [][8] { {'R','H', 'B','Q','K','B','H','R'}, {'P','P', 'P','P','P','P','P','P'}, {' ',' ',' ',' ',' ',' ',' ',' '}, {' ',' ',' ',' ',' ',' ',' ',' '}, {' ',' ',' ',' ',' ',' ',' ',' '}, {' ',' ',' ',' ',' ',' ',' ',' '}, {'p','p', 'p','p','p','p','p','p'}, {'r','h', 'b','q','k','b','h','r'}, }; const size_t nrows {size(a)}; const size_t ncols {size(a[0])}; for (int row {0}; row < nrows; ++row) { if (row > 0) { for (int col {0}; col < ncols; ++col) { if (col > 0) { cout << "+"; } cout << "---"; } cout << "\n"; } for (int col {0}; col < ncols; ++col) { if (col > 0) { cout << "|"; } cout << " " << a[row][col] << " "; } cout << "\n"; } return EXIT_SUCCESS; }