数组中的三种数组

			int[] numbers = new int[5]; //一维数组
            string[,] names = new string[4, 5]; //多维数组
            Console.WriteLine(names.Length); 
            int[][] scores = new int[4][]; //数组的数组(交错数组)
            for (int i = 0; i < scores.Length; i++)
            {
    
    
                scores[i] = new int[i + 3]; //创建交错数组
            }
            for (int i = 0; i < scores.Length; i++)
            {
    
    
                Console.WriteLine("第{0}行是{1}", i, scores[i].Length);
            }
            Console.WriteLine("数字的行数是{0}", scores.Length);

猜你喜欢

转载自blog.csdn.net/weixin_51803498/article/details/121571918