#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
int main()
{
unsigned num_lines;
std::cout << "Enter the number of lines.\n> ";
std::cin >> num_lines;
const unsigned width = 79;
std::vector<std::string> lines(num_lines); // creates a vector of num_lines default constructed strings.
for (unsigned i = 0; i < lines.size(); ++i)
lines[i] = std::string((width / 2 ) - (i * 2 + 1)/2, ' ') + std::string(i * 2 + 1, '*');
std::cout << '\n' ;
for (unsigned i = 0; i < lines.size(); ++i)
std::cout << lines[i] << '\n';
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHN0cmluZz4KCmludCBtYWluKCkKewogICAgdW5zaWduZWQgbnVtX2xpbmVzOwogICAgc3RkOjpjb3V0IDw8ICJFbnRlciB0aGUgbnVtYmVyIG9mIGxpbmVzLlxuPiAiOwogICAgc3RkOjpjaW4gPj4gbnVtX2xpbmVzOwoKICAgIGNvbnN0IHVuc2lnbmVkIHdpZHRoID0gNzk7CiAgICBzdGQ6OnZlY3RvcjxzdGQ6OnN0cmluZz4gbGluZXMobnVtX2xpbmVzKTsgIC8vIGNyZWF0ZXMgYSB2ZWN0b3Igb2YgbnVtX2xpbmVzIGRlZmF1bHQgY29uc3RydWN0ZWQgc3RyaW5ncy4KCiAgICBmb3IgKHVuc2lnbmVkIGkgPSAwOyBpIDwgbGluZXMuc2l6ZSgpOyArK2kpCiAgICAgICAgbGluZXNbaV0gPSBzdGQ6OnN0cmluZygod2lkdGggLyAyICkgLSAoaSAqIDIgKyAxKS8yLCAnICcpICsgc3RkOjpzdHJpbmcoaSAqIDIgKyAxLCAnKicpOwogICAgCiAgICBzdGQ6OmNvdXQgPDwgJ1xuJyA7CiAgICBmb3IgKHVuc2lnbmVkIGkgPSAwOyBpIDwgbGluZXMuc2l6ZSgpOyArK2kpCiAgICAgICAgc3RkOjpjb3V0IDw8IGxpbmVzW2ldIDw8ICdcbic7Cn0=