2018-12-20

#代码

Console.WriteLine("请输入等腰金字塔的塔高:");

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

            int k = hang, i = 1;

            while (i <= hang)

            {

                int j = 1;

                while (j <= k - 1)

                {

                    Console.Write("\0");

                    j++;

                }

                int x = 1;

                while (x <= 2 * i - 1)

                {

                    Console.Write("*");

                    x++;

                }

                Console.Write("\n");

                i++;

                k--;

            }

            Console.ReadKey();

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • #代码 using System; using System.Collections.Generic; using...
    柏建春阅读 149评论 0赞 0
  • #代码 using System; using System.Collections.Generic; using...
    柏建春阅读 239评论 0赞 0
  • 在C语言中,五种基本数据类型存储空间长度的排列顺序是: A)char B)char=int<=float C)ch...
    夏天再来阅读 4,236评论 0赞 2
  • #代码 Console.WriteLine("请输入直角金字塔的塔高"); int i, j, n; ...
    追魂_409e阅读 270评论 0赞 0
  • Arch Linux是一个优秀的linux操作系统。其优点是滚动发行、软件包比较新,并且可以深度可定制。缺点是由于...
    乐百川阅读 10,093评论 6赞 39

友情链接更多精彩内容