如何实现:
用户输入N个整数,则程序自动生成N个相应长度的整数数组?
比如用户输入 13 25 9
然后程序就自动生成3个长度分别为13 25 9的数组

解决方案 »

  1.   

    int[] a = new int[13];
    int[] b = new int[25];
    int[] c = new int[9];
      

  2.   

    假如你不需要保存数组原有的数据的话,直接使用new即可
    假如你需要保存数组原有数据的话,如果也要使用new方式的话,可以使用一个临时数组进行中转保存数据,要不就是用ArrayList,或者<List>
    一般人家都会使用ArrayList,或者<List>
      

  3.   

    新年好!int n = int.Parse(Console.ReadLine());
    int[] a = new int[n];
      

  4.   

    3楼应该看看Array.Resize<>()的用法。
      

  5.   

    List<Array> list = new List<Array>();
    ArrayList item = new ArrayList(len);
    list.Add(item.ToArray(typeof(type));