#include using namespace std; // Print a row with a starting and ending character, with a specified number // of middle characters between them. void row(char ends, int num_middle, char middle) { cout << ends; for(int m = num_middle; m--;) cout << middle; cout << ends << endl; } // Draw a box with text. void box(int width = 9, int height = 5, bool fill = false) { // Top row row('+', width-2, '-'); // Draw internal rows. for(int m = height-2; m--;) row('|', width-2, fill ? '#' : ' '); // Final row. row('+', width-2, '-'); } // Box driver. int main() { box(); cout << endl; box(4); cout << endl; box(15, 7); cout << endl; box(3,3,true); }