Created
November 10, 2017 20:36
-
-
Save CarlosRA97/107386c3a7fb7d120908ab70edf7ea92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
cout << "Enter the lentgh of the box: " << endl; | |
int boxSize = 0; | |
cin >> boxSize; | |
for (int row = 0; row < boxSize; row++) { | |
for (int col = 0; col < boxSize; col++) { | |
if (row == 0 or row == boxSize - 1) { | |
cout << "*"; | |
} else { | |
if (col == 0 or col == boxSize - 1) { | |
cout << "*"; | |
} else { | |
cout << " "; | |
} | |
} | |
} | |
cout << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment