Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int side;
  7.  
  8.     cout << "Enter a number: ";
  9.     cin >> side;
  10.  
  11.     int i = side;
  12.    
  13.     {
  14.         int j = 0;
  15.         while (j < i - 1)
  16.         {
  17.             cout << " ";
  18.             j++;
  19.         }
  20.         while (j < side)
  21.         {
  22.             cout << "#";
  23.             j++;
  24.         }
  25.         cout << endl;
  26.  
  27.     }
  28.     do
  29.     {
  30.         cout << endl;
  31.         i--;
  32.     } while (i > 0);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement