#include<stdio.h>
int main()
{
int i, j, k ;
int n = 13;
int m = n/2;
for (i = 1; i <= m + 1; i++)
{
for (j = 1; j <= m + 1 - i; j++)
printf(" ");
for (k = 1; k <= 2 * i - 1; k++)
printf("*");
printf("\n");
}
for (i = 1; i <= m; i++)
{
for (j = 1; j <= i; j++)
printf(" ");
for (k = 1; k <= (2 * m + 1) - 2 * i; k++)
printf("*");
printf("\n");
}
return 0;
}
打印菱形 C语言
最新推荐文章于 2024-08-21 18:16:36 发布