2018-12-20

#代码

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication2

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.Write("请输入直角三角形的行数");

            int hang = Convert.ToInt32(Console.ReadLine());

            for (int i = 0; i < hang+1; i++)

            {

                for (int j = 0; j < 2*i-1; j++)

                {

                    Console.Write("*");

                }

                Console.WriteLine("");

            }

            Console.ReadKey();

        }

    }

}

#效果


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Applying for a Visa (043) A: So, you’re applying for a B2...
    风亦可阅读 220评论 0 0
  • 【美兮修能】20181219识字营009期D28(学习力践行记录D415) 早上自己看了《鼠小弟的圣诞树》。下午晚...
    黄侠_美兮妈阅读 137评论 0 0
  • 问题描述 提前声明,这是一个意外,并不能证明我的智商存在问题233 在学习Angular2入门教程时,我发现在组件...
    歇歇阅读 1,516评论 0 0
  • 教学过程中,往往会出现一种很尴尬的情况,那就是“千辛万苦找到好的试卷,却不会设置答题卡。”答题卡制作真的有那么难吗...
    易百阅读 1,554评论 0 0
  • songshu阅读 1,258评论 1 3