#include
using namespace std;
int main() {
int n;
cin>>n;
for (int i=1;i<=n;i++)
{
if (i==1 || i==n)
{
for (int j=0;j<n;j++)
{
cout<<"*"<<"\t";
}
cout<<endl;
}
else if (i!=1 && i<=(n/2))
{
for (int j=0;j<n/2;j++)
{
cout<<"*"<<"\t";
}
for (int j=0;j<(n/2)-1;j++)
{
cout<<"\t";
}
for (int j=0;j<n/2;j++)
{
cout<<"*"<<"\t";
}
cout<<endl;
}
else if (i==(n/2)+1)
{
cout<<"*";
for (int j=0;j<n-1;j++)
{
cout<<"\t";
}
cout<<"*"<<endl;
}
else if (i!=n && i>(n/2)+1)
{ for (int j=0;j<n/2;j++)
{
cout<<"*"<<"\t";
}
for (int j=0;j<(n/2)-1;j++)
{
cout<<"\t";
}
for (int j=0;j<n/2;j++)
{
cout<<"*"<<"\t";
}
cout<<endl;
}
else if (i==n)
{
for (int j=0;j<n;j++)
{
cout<<"*"<<"\t";
}
}
}
return 0;
}
This is the code. Provide guidance.