#include <iostream>
using namespace std;

int main() {
    int row;
    cin>>row;

    for(int i=1;i<=row;i++)
        {
            for(int j=1;j<=row;j++)
                {
                    if((i==j) || (i+j==row+1))
                    {
                        cout<<"*";
                    }
                    else
                    {
                       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: