ylbtech-Unitity-CS-Arrays:数组

ylbtech-Unitity-CS-Arrays:数组
1.A,效果图返回顶部
 
1.B,源代码返回顶部
1.B.1,
using System;
class DeclareArraysSample
{
    public static void Main()
    {
        // 一维数组
        int[] numbers = new int[5];

        // 多维数组
        string[,] names = new string[5,4];

        // 数组的数组(交错数组)
        byte[][] scores = new byte[5][];

        // 创建交错数组
        for (int i = 0; i < scores.Length; i++)
        {
            scores[i] = new byte[i+3];
        }

        // 打印每行的长度
        for (int i = 0; i < scores.Length; i++)
        {
            Console.WriteLine("Length of row {0} is {1}", i, scores[i].Length);
        }
    }
}
1.B.2,
1.C,下载地址返回顶部

 

warn 作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
原文地址:https://www.cnblogs.com/ylbtech/p/5062050.html