x对象在使用时仍然能和二维数组一样使用。例如x[3][5]

解决方案 »

  1.   

    可以这样定义:
    List<List<int>> x=new List<List<int>> ();那么,如何将下列二维数据赋值给x呢:1 3 5 7
    6 1 4 4
    7 0 2 3
      

  2.   

    List <List <int>> x=new List <List <int>> ({{1, 3, 5, 7},{6, 1, 4, 4 },{7, 0 ,2, 3}); 
      

  3.   

    hash套hash...arraylist套arraylist...
      

  4.   


    List<List<int>> x = new List<List<int>> ({ { 1, 3, 5, 7 }, { 6, 1, 4, 4 }, { 7, 0, 2, 3 } }); 
    这样语法错误,应该怎么初始化呢?
      

  5.   


    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    namespace ConsoleAppSet
    {
        class Class1
        {
            private void StorePerson()
            {
                List<Person> list = new List<Person>();
                Person p1 = new Person();
                p1.FIRST_NAME = "Tom";
                p1.LAST_NAME = "Li";
                p1.AGE = 24;            list.Add(p1);
            }
        }    struct Person
        {
            public string FIRST_NAME;
            public string LAST_NAME;
            public int AGE;
        }
    }
      

  6.   

    哦,错了。
    这样:
    List <List<int>> x = new List <List<int>>() {new List<int> { 1, 3, 5, 7 }, new List<int>{ 6, 1, 4, 4 }, new List<int>{ 7, 0, 2, 3 } };