Daily Code - output pattern graphics

Today's one yard daily to introduce some code common graphical output of different shapes in the console.

 

First look at how to output the multiplication tables:

 


 

 

 

The following look at how the output of a triangle:

 


 

 

Outermost loop is responsible for driving down the output, the inner nested loop outputs three responsible for part of the image, are left blank portion, left portion and right portion triangular triangle.

 

Finally, let us look at an example, print hollow triangle:

 


 

 

In the console output pattern, most of the multilayer loop nest. At this time, the first output pattern need to observe the law, the image is cut in portions output.

 

You can also try other graphics oh, say, heart-shaped, diamond and so on.

 

Due to the limited small series level, if insufficient, please let us know! ! ! Here is the focus, write down a note. Concerned about the micro-channel public number Ink Mountains, for more information about the article! ! !


 

◆◆

The ink is dry, why stop with both hands!

◆◆


 

Thanks for attention!

Micro Signal: youmoshan

Guess you like

Origin www.cnblogs.com/skylife/p/11105247.html