如写一个方法
privaet string random(max:string,min:string)
{
Random ro=new Random();
ro.NextDouble();
//然后怎么样才能生成max和min之间的随机小数
return
}
privaet string random(max:string,min:string)
{
Random ro=new Random();
ro.NextDouble();
//然后怎么样才能生成max和min之间的随机小数
return
}
int ne = ro.Next(0, 100);
double d = ne * ro.NextDouble();
Random rand = new Random();
private string random( string max, string min)
{
float maxF = float.Parse(max);
float minF = float.Parse(min); // up to four decimal digit accuracy
float f = minF + rand.Next( (maxF - minF) * 10000 ) / 10000.0f;
return f.ToString();
}
{
double[][] array = new double[x][y];
for(int i = 0; i < array.length; i++)
for(int j = 0; j < array[i].length; j++)
{
array[i][j] = Math.random()*(max-min)+min;
}
return array;
}
不好意思,这是java的方法,呵呵