#include<stdio.h>
int main()
{
int i,j,n=6;
for(j=1;j<=n-1;++j)
printf(" ");
printf("*\n");
for(i=2;i<=n-1;++i)
{
for(j=1;j<=n-i;++j)
printf(" ");
printf("*");
for(j=1;j<=2*i-3;++j)
printf(" ");
printf("*\n");
}
for(j=1;j<=2*n-1;++j)
printf("*");
printf("\n");
return 0;
}
![](https://i-blog.csdnimg.cn/blog_migrate/963588891e9bd39961fee44a9e3af2d1.png)