【 tulaoshi.com - 编程语言 】
#includestdio.h
main()
{
int num; while (num != 0){
if (num == 0)
return 0;
printf("Enter a number (3-77):");
scanf("%ld", &num);
while (num77 num3){
printf("Enter error!");
printf("Please enter a number(3-77):");
scanf("%d", &num);
}
for (int i=0; i=(num-1)/2; i++)
{
for (int k=0; k=num/2-i; k++)
printf(" ");
for (int j=0; j=2*i; j++)
printf("*");
printf("");
}
for (int w=0; w=num/2; w++){
for (int m=-1; m=w; m++)
printf(" ");
for (int n=1; n=(num-2)-2*w; n++)
printf("*");
printf("");
}
}
}