Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void printHollowSquare(int n)
- {
- string topBottom = string(n, '*');
- string middle = '*' + string(n - 2, ' ') + '*';
- cout << topBottom << endl;
- for (int iRow = 1; iRow < n - 1; iRow++)
- {
- cout << middle << endl;
- }
- cout << topBottom << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement