用Contains判断值是否已经在List中。
public static List<int> removeRepeat(List<int> repeat)
{
List<int> list = new List<int>();
foreach(int i in repeat)
{
if ( !list.Contains(repeat[i]) )
{
list.Add(repeat[i]);
}
}
return list;
}