Print shape programming ideas:
let the shape of regular programming is nothing more than control of rows and columns, the use of dual or multiple write cycles
such as printing a shape
*
**
***
****
*****
******
An outer loop control line, the control loop within the column
, for example, printing a shape
******
*****
****
***
**
*
A shape like
*
***
*****
*******
*********
***********
Still the outer-loop control lines, the inner loop control column, but the output is not within a loop , and in still output spaces before
a total of six lines, the last line is not output spaces, a fifth line space. . . A law of space is found and so the number of rows the number of rows minus
and *
is, a first row *
, second row three *
, of Law 2i-1 th *
, i is the row
programming below
as a shape
***********
*********
*******
*****
***
*
And much like the shape and the last, only need to control a line on the line, the line will reverse the output
to write a Shell program, a print by the " *
" side length is composed of 8 equilateral triangle upright on behalf of (a side length asterisk one unit). Shape as
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
The shape and the like above. Is a *
followed by a space directly *+空格
as a whole
C language programming as
an important programming ideas, just know that these ideas, either shell or the only C language or Java language syntax is just not the same, for example,
***********
*********
*******
*****
***
*
The shape of the shell programming shell written as follows