Advertisement
avr39ripe

BR012debugBasics

Feb 10th, 2021
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <chrono>
  3. #include <thread>
  4.  
  5. int main()
  6. {
  7.  
  8.     int side{5};
  9.     //std::cout << "enter line length\n";
  10.     //std::cin >> side;
  11.     char symb = '#';
  12.  
  13.     for (int y{ 0 }; y < side; ++y)
  14.     {
  15.         for (int x{ 0 }; x < side; ++x)
  16.         {
  17.             symb = ' ';
  18.  
  19.             if (x + y == (side - 1) and (x == y))
  20.             {
  21.                 symb = '*';
  22.             }
  23.  
  24.             std::cout << ' ' << symb << ' ';
  25.            
  26.         }
  27.         std::cout << '\n';
  28.     }
  29.  
  30.     return 0;
  31. }
  32. //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