#include <stdio.h>
#include <math.h>
int main(){
/* declaration */
int x;
int y;
int z;
/* define how many line will be print */
for (x=1; x<=9; x++)
{
/* define how many " " will be print in every line */
for (y=1; y<=fabs(5-x); y++)
{
printf(" ");
}
/* define how many "*" will be print in every line */
for (z = 1; z<= 2*fabs(fabs(5-x)-5)-1; z++)
{
printf("*");
}
/* finish the line then return */
printf("\n");
}
return 0;
}
在屏幕中打印9*9的菱形
最新推荐文章于 2022-11-20 20:51:53 发布