using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
//交错数组
int[][] Arr = new int[3][];
Arr[0] = new int[] { 10,20,30};
Arr[1] = new int[] { 40,50,60,70};
Arr[2]=new int[]{80,90,100,110,120};
Console.WriteLine("array length: {0}", Arr.Length);
for (int i = 0; i < 3; i++)
for (int j = 0; j < Arr[i].Length; j++)
{
Console.WriteLine("Element [{0},{1}] is {2}", i, j, Arr[i][j]);
}
}
}
}
C#交错数组
最新推荐文章于 2021-09-24 11:51:27 发布