Home > Back-end >  Strives for the big help
Strives for the big help

Time:09-25

In c, the output of the pyramid * what is thinking, please??

CodePudding user response:

Can directly use the blank space key and * build a pyramid

CodePudding user response:

Fill the two-dimensional space
 
# include
Int main () {
Int size, I, j;
The scanf (" % d ", & amp; The size);
For (I=1; i <=the size; + + I) {
For (j=0; J & lt; Size - I; + + j)
Printf (" ");
For (j=0; J & lt; 2 * I - 1; + + j)
printf("*");
printf("\n");
}
}

CodePudding user response:

Cycle
Print a space
Print *
Print a space
Print the enter
The third can be omitted

CodePudding user response:

Mentality,,, you can be thought of as output a rectangle, rectangle, you're always right, and then output * after part of the judgment of the pyramid, the pyramid output space after part of the judgment

CodePudding user response:

Imagine a computer screen is the matrix one by one, just like
.
.
.
.
.
.
That now you are on the dot matrix display pyramid, general idea is to put a pyramid, the pyramid obscure places output *, other places don't do processing,

CodePudding user response:

reference 3/f, 636 f6c696e response:
cyclePrint a space
Print *
Print a space
Print the enter
The third can omit

But the lower level of * is not in a line

CodePudding user response:

reference 1st floor 莯 green and xian reply:
can directly use the blank space key and * build a pyramid

You this answer is ,,,

CodePudding user response:

CodePudding user response:

If it is 9, 5 lines before a large cycle, 4 line after a large cycle, large cycle space inside a tiny, * a minor cycle with respect to OK

CodePudding user response:

references 9 f BakenJ response:
if it is 9, 5 lines before a large cycle, 4 line after a large cycle, large cycle space inside a tiny, * a minor cycle with respect to OK
oh, this is a diamond

CodePudding user response:

Can use the Spaces and * print directly
  • Related