输出菱形
#include<stdio.h>
#include<math.h>
int main()
{
int i,k,j,h;
while(1)
{
printf("input half of height:\n");
scanf("%d",&h);
for(i=-h;i<=h;i++)
{
for(k=1;k<=abs(i);k++)
printf(" ");
for(j=1;j<=2*h+1-2*abs(i);j++)
printf("*");
printf("\n");
}
}
return 0;
}