Commit 84e0b90f authored by Michael's avatar Michael

just commit

parent 10e35394
...@@ -4,9 +4,12 @@ ...@@ -4,9 +4,12 @@
int int
main() main()
{ {
for (int row = 4; row >= -4; --row) { const int ROW_LIMIT = 4;
for (int column = -3; column <= 5 - std::abs(row); ++column) { const int rowBegin = -4;
std::cout << (column <= std::abs(row) - 4 ? " " : "*"); for (int row = rowBegin; row <= ROW_LIMIT; ++row) {
const int COLUMN_LIMIT = 4 - std::abs(row);
for (int column = rowBegin; column <= COLUMN_LIMIT; ++column) {
std::cout << (column < -COLUMN_LIMIT ? " " : "*");
} }
std::cout << std::endl; std::cout << std::endl;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment