Making pyramid using c#

后端 未结 13 2182
花落未央
花落未央 2021-01-03 11:04

My question is how to make a pyramid using * and \'space\' in C#? The output will be like this.

     *
    * *
   * * *
  * * * *
 * * * * *
<
13条回答
  •  一个人的身影
    2021-01-03 11:29

    Try to think of it as a grid or a matrix and see where you want the '*' in each row and how it relates to your loop index.

提交回复
热议问题