Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
160
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.     do
  13.     {
  14.         cout << endl;
  15.         i--;
  16.     }
  17.     while (i > 0);
  18.     {
  19.         int j = 0;
  20.         while (j < i - 1)
  21.         {
  22.             cout << " ";
  23.             j++;
  24.         }
  25.         while (j < side)
  26.         {
  27.             cout << "#";
  28.             j++;
  29.         }
  30.         cout << endl;
  31.  
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement