Commit 84f76b9c by Karine

Exercise_05_24, Version3

parent be7c6fbe
......@@ -15,18 +15,12 @@ main()
}
std::cout << std::endl;
row -= 1;
row /= 2;
for(int i = -row; i <= row; ++i) {
for(int j = -row; j <= row; ++j) {
if( std::abs(i) + std::abs(j) <= row) {
std::cout << "*";
}
else {
std::cout << " ";
}
}
for (int i = -row; i <= row; ++i) {
for (int j = -row; j <= row; ++j) {
std::cout << ((std::abs(i) + std::abs(j) <= row) ? "*" : " ");
}
std::cout << std::endl;
}
return 0;
......
Enter the odd count of rows (from 1 to 19):
*
***
*****
*******
*********
***********
*************
***********
*********
*******
*****
***
*
*
***
*****
*******
*********
***********
*************
***************
*************
***********
*********
*******
*****
***
*
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