#include #include using namespace std; int main() { const char a[][3] { {' ', ' ', 'O'}, {' ', 'X', ' '}, {'X', ' ', ' '} }; const size_t nrows {size(a)}; //the number of rows const size_t ncols {size(a[0])}; //the number of columns for (int row {0}; row < nrows; ++row) { //Important //Draw a horizontal line of dashes and plusses //above every row except the first. if (row > 0) { for (int col {0}; col < ncols; ++col) { if (col > 0) { cout << "+"; } cout << "---"; } cout << "\n"; } for (int col {0}; col < ncols; ++col) { //Important //Draw a vertical line of |s //in front of every column except the first. if (col > 0) { cout << "|"; } cout << " " << a[row][col] << " "; //Important } //Important cout << "\n"; //Important } //Important return EXIT_SUCCESS; }