1个回答
展开全部
朋友您好!
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i, j;
for (i = 1; i <= 5; i += 2)
{
for (j = 1; j <= i; j++)
printf ("*");
printf ("\n");
}
for (i = 3; i >= 1; i -= 2)
{
for (j = 1; j <= i; j++)
printf ("*");
printf ("\n");
}
system ("pause");
return 0;
}
望采纳!
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i, j;
for (i = 1; i <= 5; i += 2)
{
for (j = 1; j <= i; j++)
printf ("*");
printf ("\n");
}
for (i = 3; i >= 1; i -= 2)
{
for (j = 1; j <= i; j++)
printf ("*");
printf ("\n");
}
system ("pause");
return 0;
}
望采纳!
更多追问追答
追问
*
***
*****
***
*
追答
嗯,那这样子:
#include
#include
int main ()
{
int i, j, k;
for (i = 1; i = i; k-=2)
printf (" ");
for (j = 1; j = 1; i -= 2)
{
for (k = i; k <= 5; k+=2)
printf (" ");
for (j = 1; j <= i; j++)
printf ("*");
printf ("\n");
}
system ("pause");
return 0;
}
望采纳!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询