using System;
using System.Collections.Generic;
using System.Text;
namespace cls_Array_multi
{
class Program
{
static void Main(string[] args)
{
// 11 12 35
// 34 23 67
// 两行三列的二维数组ArrayM
int[,] ArrayM;
//ArrayM = new int[2,3]{ { 11, 12, 35 }, { 24,23,67} }; // ArrayM = new int [2,3]{{11,12,35} , {24,23,67}};(两个错误)
ArrayM = new int[,] { { 11, 12, 35 }, { 24, 23, 67 } };
/*
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 3; j++)
{
//Console.Write(ArrayM[i,j] + " "); //i=0 : ArrayM[0,0],ArrayM[0,1],ArrayM[0,2]
// i = 1:ArrayM[1,0], ArrayM[1,1], ArrayM[1,2]
Console.Write(" array[ {0} ,{1} ] = {2} ", i, j, ArrayM[i, j] ); //0,1,2
}
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载