Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <chrono>
- #include <thread>
- int main()
- {
- int side{5};
- //std::cout << "enter line length\n";
- //std::cin >> side;
- char symb = '#';
- for (int y{ 0 }; y < side; ++y)
- {
- for (int x{ 0 }; x < side; ++x)
- {
- symb = ' ';
- if (x + y == (side - 1) and (x == y))
- {
- symb = '*';
- }
- std::cout << ' ' << symb << ' ';
- }
- std::cout << '\n';
- }
- return 0;
- }
- //std::this_thread::sleep_for(std::chrono::milliseconds(200)); //make some pause for better output look :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement