Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <chrono>
- #include <thread>
- //0 1 2 3 4
- //* # # # #
- //# * # # #
- //# # * # #
- //# # # * #
- //# # # # *
- bool positive{ true };
- const char posSymb{ '#' };
- const char negSymb{ ' ' };
- a > b;
- int main()
- {
- const int size{ 5 };
- for (int y{ 0 }; y < size; ++y)
- {
- for (int x{ 0 }; x < size; ++x)
- {
- //positive = (y == x) or (y + x == size - 1);
- //positive = (y >= x);
- positive = (y >= x) and (y + x >= size - 1);
- std::cout << ' ' << (positive ? posSymb : negSymb) << ' ';
- //std::this_thread::sleep_for(std::chrono::milliseconds(500));
- }
- std::cout << '\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment