Home > Back-end >  Print * diamond
Print * diamond

Time:01-22

# include
The main ()
{
Int I, j, k;
for(i=1; I<=6; I++)
{
For (j=1; j<=8 - I; J++)
{
printf(" ");
}
For (j=1; j<+ 2 * I; J++)
{
printf("*");
}
printf("\n");
}
For (k=5; K>=1; - k)//for (k=1; k<=5; K++)
{
For (j=1; j<=8 - k; J++)
{
printf(" ");
}
For (j=1; j<+ 2 * k; J++)
{
printf("*");
}
printf("\n");
}

}

CodePudding user response:

Can participate
  • Related