// List<int> scoreList = new List<int>();//创建空列表var scoreList=new List<int>();//匿名方式创建scoreList.Add(912);//插入数据scoreList.Add(45);scoreList.Add(415);scoreList.Add(452);scoreList.Add(4451);scoreList.Add(245);scoreList.Add(445);// Console.WriteLine(scoreList[0]);//根据索引访问数据//遍历列表(for)//for (int i = 0; i < scoreList.Count; i++)//{// Console.WriteLine(scoreList[i]);//}//遍历列表( foreach )//foreach (int temp in scoreList)//{// Console.WriteLine(temp);//}//insert方法//scoreList.Insert(1,2000);//foreach (int temp in scoreList)//{// Console.WriteLine(temp);//}//RemoveAt方法//scoreList.RemoveAt(0);//foreach (int temp in scoreList)//{// Console.WriteLine(temp);//}//IndexOf方法//int index= scoreList.IndexOf(445);//Console.WriteLine(index);//Sort方法scoreList.Sort();foreach (int temp in scoreList){Console.WriteLine(temp);}