Random ranom = new Random();
int temp = -1;
for (int i = 0; i < 100; i++)
{
//如果获得的随机数已经包含在该数组里 那么重新获得随机数
while( arr.Contains(temp) || temp == -1)
{
temp = ranom.Next(1, 101);
}
List<int> lists = new List<int>();
Random ranom = new Random();
while(lists.Count!=100){
int tmp = ranom.Next(1, 101);
if(!list.Contains(tmp)){
lists.Add(tmp);
}
}