首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

请教一上!这个是什么

2012-10-09 
请问一下!这个是什么using Systemusing System.Collections.Genericusing System.Linqusing System.Tex

请问一下!这个是什么
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace do_two_array
{
  class Program
  {
  static void Main(string[] args)
  {
  int [,] a, b;
  a = new int[3, 2] { { 1, 2 }, { 3, 4 }, { 5, 6 } };
  b = new int[,] { { 4, 6 }, { 8, 10 }, { 15, 20 }, };
  Console.WriteLine("a矩阵中的数据如下: ");
  for (int i = 0; i < 3; i++)
  {
  for (int j = 0; j < 2; j++)
  Console.WriteLine("{0}", a[i, j]);
  Console.WriteLine();
  }

  }
  }
}
上面代码的 i j代表的是什么, a[i,j]代表的是什么


[解决办法]
表示下标和数组中指定下标对应的数。
[解决办法]
二维数组的坐标 相当于 x . y 也可以蛮理解是两个字段的表
[解决办法]
i 和 j就是for循环时候用来表示这是第几次循环的一个标记变量。a[i,j]根据当时i和j的值来显示数组中元素

热点排行