"EASIEST EXPLANATION EVER"
/*
n=4
*
***
*****
*******
*/
#include <iostream>
using namespace std;
int main() {
int n=4; //indicates the number of rows.
int max_breadth=(n-1)*2+1, mid=breadth/2; //max_breadth indicates the maximum no. of '*' in the last row.
for(int i=0;i<n;i++)
{
int range_start=mid-i,range_end=mid+i;
for(int j=0;j<max_breadth;j++)
{
if(j>=range_start && j<=range_end){
cout<<"*";
}
else{
cout<<" ";
}
}
cout<<endl;
}
return 0;
}