int[] sore = new int[100];
ArrayList list = new ArrayList();//声明集合
Random r = new Random();
//集合添加数字
while(list.Count<100)
{
int s = r.Next(1, 101);
if(!list.Contains(s))
list.Add(s);
}
//遍历数组,把集合的书给数组
for (int j = 0; j <sore.Length;j++ )
{
sore[j] = (int)list[j];
Console.Write("{0}",sore[j]);
Console.WriteLine();
}
ArrayList list = new ArrayList();//声明集合
Random r = new Random();
//集合添加数字
while(list.Count<100)
{
int s = r.Next(1, 101);
if(!list.Contains(s))
list.Add(s);
}
//遍历数组,把集合的书给数组
for (int j = 0; j <sore.Length;j++ )
{
sore[j] = (int)list[j];
Console.Write("{0}",sore[j]);
Console.WriteLine();
}