#include <iostream>

using namespace std;

int main() {
    int N;
    
    cout << "Altura: ";
    cin >> N;
    
    for (int i = 1; i <= N; i++) {
        // Imprimir espacios
        for (int j = 1; j <= N - i; j++) {
            cout << " ";
        }
        // Imprimir asteriscos impares
        for (int k = 1; k <= (2 * i - 1); k++) {
            cout << "*";
        }
        cout << endl;
    }
    
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: