CodePudding user response:
Can directly use the blank space key and * build a pyramidCodePudding 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:
CyclePrint 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 judgmentCodePudding 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: