int n;
scanf(“%d”,&n);
int cx =n/2,cy =n/2;
for(int i = 0;i<n;i)
{
for(int j = 0;j<n;j)
{
if(abs(i-cx)+abs(j-cy)<=n/2)
printf(“*”);
else printf(” “);
}
printf(“\n”);
}
return 0;
//cx = n/2,cy = n/2
//曼哈顿距离abs(i-cx)+abs(j-cy)<=n/2