[ create a new paste ] login | about

Link: http://codepad.org/oMKIX4Fx    [ raw code | output | fork ]

C++, pasted on Dec 27:
#include <iostream>
#include <cstdlib>
int main(int argc, char* argv[])
{
    std::cout << "\n\n";
    int len = 13;
    int wid = len / 2  +1;     
    int ht = len /2  - 3;
    for(int i = -1; i < len; ++i)
    {
        for(int j = len - i; j > -1; j--)
            std::cout << " ";
        
        for(int k = 2 * i + 1; k >= -1; k--)
            std::cout << "*";
            
        std::cout << std::endl;
    }
    for(int c = 0; c < ht; ++c)
    {
        for(int a = 0; a < len; ++a)    
        {
            std::cout << " ";
        }
        for(int b = 0; b < wid; ++b)
        {
            std::cout << "*";
        }
        std::cout << std::endl;
    }
    return 0;
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19


               *
              ***
             *****
            *******
           *********
          ***********
         *************
        ***************
       *****************
      *******************
     *********************
    ***********************
   *************************
  ***************************
             *******
             *******
             *******


Create a new paste based on this one


Comments: