zoukankan      html  css  js  c++  java
  • C# 多维数组.

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

    namespace ConsoleApplication1
    {
        class Program
        {

            static void Main(string[] args)
            {
                int[][] myArr = new int[2][];
                myArr[0] = new int[3] { 1, 2, 3 };    //需要说下这是锯齿数组才会有下面的  行.length 的属性,试了标准的多维数组没有这属性的。 声明也不一样是 int[,,] 类型。
                myArr[1] = new int[2] { 4, 5 };
                Console.WriteLine(myArr.Rank);
                for (int i = 0; i < myArr.Length; i++)
                {
                    for (int j       = 0; j < myArr[i].Length; j++)
                    {
                        Console.WriteLine("行数:{0,-5}列数:{1,-5}值为{2,3}",i,j,myArr[i][j]);

                    }
                   
                }
            }
        }
    }

  • 相关阅读:
    Python基础之 一 字典(dict)
    python基础之-字符串
    Python基础之 一列表
    Python基础之 一 补充
    python基础之-数据类型
    python之模块随笔记-sys
    python之练习-三层菜单
    Python基础之 二
    SQL Server 数据类型
    SQLServer视图
  • 原文地址:https://www.cnblogs.com/fat_li/p/1849953.html
Copyright © 2011-2022 走看看