using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
//泛型集合的使用
//新建集合
List<int> scoreList = new List<int>();
scoreList.Add(99);
scoreList.Add(98);
List<string> nameList = new List<string>(){"小李","小张"};
//向集合第2个后插入数据
scoreList.Insert(2, 70);
//删除数据
scoreList.Remove(99);
//遍历集合
for(int i=0;i<scoreList.Count;i++)
{
Console.WriteLine("第{0}个数是{1}",i, scoreList[i]);
}
}
}
}
输出结果第 第0个数是98 第1个数是70