#include
int main()
{int i,j,n,k;
scanf("%d",&n);
for(i=0;i { for(j=0;j printf("*"); for(j=0;j
printf(" "); k=i==0; for(j=0;j printf("*"); printf("\n"); } for(i=n-2;i>=0;i--) { for(j=0;j printf("*"); for(j=0;j
printf(" "); k=i==0; for(j=0;j printf("*"); printf("\n"); } return 0; }
#include
int main()
{
int i,j,k,line,m;
printf("请输入行数:");
scanf("%d",&line);
m=(line+1)/2;
for(i=1;i<=m;i++)
{
for(k=0;k
printf(" ");
}
printf("*");
if(i==1){printf("\n");continue;}
for(j=0;j<2*i-3;j++)
{
printf(" ");
}
printf("*");
printf("\n");
}
for(i=m-1;i>0;i--)
{
for(k=0;k
printf(" ");
}
printf("*");
if(i==1){printf("\n");continue;}
for(j=0;j<2*i-3;j++)
{
printf(" ");
}
printf("*");
printf("\n");
}
return 0;
}