Commit fa4fe739 authored by Michael's avatar Michael

michael.davityan:exercise_05_23v7

parent de75dfc8
...@@ -5,10 +5,9 @@ int ...@@ -5,10 +5,9 @@ int
main() main()
{ {
const int ROW_LIMIT = 4; const int ROW_LIMIT = 4;
const int rowBegin = -4; for (int row = -ROW_LIMIT; row <= ROW_LIMIT; ++row) {
for (int row = rowBegin; row <= ROW_LIMIT; ++row) {
const int columnLimit = 4 - std::abs(row); const int columnLimit = 4 - std::abs(row);
for (int column = rowBegin; column <= columnLimit; ++column) { for (int column = -ROW_LIMIT; column <= columnLimit; ++column) {
std::cout << (column < -columnLimit ? " " : "*"); std::cout << (column < -columnLimit ? " " : "*");
} }
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