pola bintang berlian di cpp

include <bits/stdc++.h>             //       *
using namespace std;                //      ***
int main()                          //     *****
{                                   //      ***
    int n, i, j;                    //       *
	cin>>n;
    int m = n;
 // FOR UPPER Half
	for(i=1; i<=n; i++)
	{
		for(j=0; j<m-1; j++)
			cout<<" ";

		for(j=0; j<2*i-1; j++)
			cout<<"*";

		cout<<"\n";
		m--;
	}
  // FOR LOWER Half
	for(i=n-1; i>=1; i--)
	{
		for(j=0; j<m+1; j++)
			cout<<" ";
		for(j=0; j<2*i-1; j++)
			cout<<"*";
		    cout<<"\n";
		m++;
	}
}
Talented Tern