文件名称:intRandom1-100
介绍说明--下载内容均来自于网络,请自行研究使用
获取随机数,根据所用到的方法,其中包含了学多方法- class GetRandomArray
{
public GetRandomArray()
{
arr = new int[100]
}
int[] arr
private bool checkNumber(int arrlist)
{
for (int i = 0 i < arrlist i++)
{
if (arr[i] == arr[arrlist])
{
return true
}
}
return false
}
//生成数组
public int[] produceRandomArray()
{
Random rd = new Random()
for (int i = 0 i < 100 ++i)
{
//int temp=0
do
{
//temp = rd.Next(1, 101)
//arr[i] = temp
arr[i] = rd.Next(1, 101)
}
while (checkNumber(i))
}
return arr
}
}
{
public GetRandomArray()
{
arr = new int[100]
}
int[] arr
private bool checkNumber(int arrlist)
{
for (int i = 0 i < arrlist i++)
{
if (arr[i] == arr[arrlist])
{
return true
}
}
return false
}
//生成数组
public int[] produceRandomArray()
{
Random rd = new Random()
for (int i = 0 i < 100 ++i)
{
//int temp=0
do
{
//temp = rd.Next(1, 101)
//arr[i] = temp
arr[i] = rd.Next(1, 101)
}
while (checkNumber(i))
}
return arr
}
}
(系统自动生成,下载前可以参看下载内容)
下载文件列表
intRandom1-100.txt