加载中…
  
博文
标签:

c

杨辉三角形

遍历

数组

元素

分类: 学海无涯

运用VS中C#控制台程序编写杨辉三角,代码如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

           int length = 0;//杨辉三角形的长度 
           Console.Write('输入杨辉三角长度:'); 
           length = Convert.ToInt32(Console.ReadLine());//指定杨辉三角形的长度
           int[][] a = new int[length][];//二维数组
           for (int i = 0; i < a.Length; i++)
  &n

  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有