110,549
社区成员
发帖
与我相关
我的任务
分享
int[,] d = new int[4, 6] { { 1, 2, 2, 3, 4, 4 }, { 5, 6, 6, 7, 8, 9 }, { 4, 6, 3, 8, 6, 6 }, { 4, 6, 3, 8, 6, 6 } };
int a = d.GetUpperBound(0)+1;//结果4
int t =d.Length /(d.GetUpperBound(0)+1);
//结果6
public void TS5()
{
string[,] array = new string[2,5];
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 5; j++)
{
array[i,j] = i.ToString();
}
}
Console.WriteLine(array.Length.ToString());// 结果 是10
Console.WriteLine(array.Rank.ToString());//结果 是 2
Console.WriteLine((array.Length / array.Rank).ToString());//结果 是 5
}