本帖最后由 caozhy 于 2011-04-05 15:50:17 编辑

解决方案 »

  1.   

    你的Columns和rows初始值是什么,没看到
    这问题,自己跟踪一下就知道了
      

  2.   

    检查看看 int Columns = Int32.Parse(args[0]);
                int Rows = Int32.Parse(args[1]);
    这俩值。
      

  3.   

    调试看看具体哪一句报错
    x = new int[columns, rows]一般应该是[rows, columns]吧
      

  4.   

    x没有正确的初始化。
    x=new int [columns];
    for(int i=0;i<columns;i++)
        x[i]=new int[Rows];
      

  5.   

    //int Columns = Int32.Parse(args[0]);
    //int Rows = Int32.Parse(args[1]);
    int Columns = 5;
    int Rows = 2;先这样试试把
    另外 学会下断点 调试
      

  6.   

    这里的j=columns,所以报错
                for (k = 0; k < rows; k++)
                    x[j, k] = randomNumber.Next(1, 100);
    你的j循环实际上是
                    x[j, 0] = randomNumber.Next(1, 100);这两个循环的效果,只是搞了一行和一列,而不是整个阵列,不太对头