通过本文主要向大家介绍了数组随机数,java数组随机数,数组产生随机数,数组模拟随机数,生成随机数数组等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
List<int> list = new List<int>();
Random ran = new Random();
while(true)
{
if (list.Count >= 100)
{
break;
}
int s = ran.Next(1, 101);
if (!list.Contains(s))
{
list.Add(s);
}
}
list.Sort();
foreach (int i in list)
{
Console.Write(i + " ");
}
Console.ReadKey();
}
}
}
</div>
</div>

