#include<stdio.h>
#include<math.h>
int main()
{
int k,j,m;
printf("please input a positive number\n");
scanf("%d",&m);
/*printf("------------------------\n");
for(k=1;k<=2*m+1;k++)
{
for(j=1;j<=abs(m+1-k);j++)
printf(" ");
for(j=1;j<=-2*abs(k-m-1)+2*m+1;j++)
printf("*");
putchar('\n');
}
printf("--------------------------\n");
for(k=-m;k<=m;k++)
{
for(j=-m;j<=m;j++)
if(abs(k)+abs(j)<=m)
printf("*");
else
printf(" ");
putchar('\n');
}
printf("--------------------------\n");*/
for(j=1;j<=2*m+1;j++)
{
for(k=1;k<=2*m+1;k++)
{ if(j<=m+1)
if(((j+k)>=m+2)&&((j+k)<=m+2+2*(k-1)))
printf("*");
else
printf(" ");
else
if(((j+k)>=m+2+2*(k-m-1))&&((j+k)<=2*m+2))
printf("*");
else
printf(" ");
}
putchar('\n');
}
}