[ create a new paste ] login | about

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

C++, pasted on Dec 17:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
using namespace std;
int main()
{
for (int i = 1; i <= 4; i++)
{
for (int j = 1; j <= 4 - i; j++) cout << " ";
for (int k = 1; k <= 2 * i - 1; k++) cout << "*";
cout << endl;
}
for (int i = 3; i > 0; i--)
{
for (int j = 1; j <= 4 - i; j++) cout << " ";
for (int k = 1; k <= 2 * i - 1; k++) cout << "*";
cout << endl;
}
}


Output:
1
2
3
4
5
6
7
   *
  ***
 *****
*******
 *****
  ***
   *


Create a new paste based on this one


Comments: