使用星星打印形状 [英] printing shapes using stars
本文介绍了使用星星打印形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
用星星绘制不同形状的方法是什么?
例如:
n = 5(行数)
*
**
***
****
*****
what is the method of drawing different shapes with stars?
for example:
n=5(number of rows)
*
**
***
****
*****
推荐答案
对于这样一个简单的形状,两个弯曲的环和一个printf
就足够了.
For such a simple shape two annided loops and a printf
are enough.
这篇关于使用星星打印形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文