using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ArrayDemo01
{
internal class Program
{
static void Main(string[] args)
{
int[,] arr1 = new int[,] { { 1, 2, 3 }, { 4, 5, 6 }, { 6, 7, 8 } };
for (int i = 0; i < arr1.GetLength(0); i++)
{
for(int j=0; j<arr1.GetLength(1); j++)
{
Console.Write(arr1[i,j] + " ");
}
Console.WriteLine();
}
int[] arr = new int[10] {10,20,30,40,50,60,70,80,90,100 };
foreach (int i in arr)
{
Console.Write(i + " ");
}
Console.ReadLine();
}
}
}
array.GetLength(0)----获取二维数组的行数
array.GetLength(1)----获取二维数组的列数