StringBuilder MyCi = new StringBuilder();
for (int x = 0; x < 300; x++)
{
Random Rand = new Random();
MyCi.Append(Rand.Next(0,1000 + " ");
} MessageBox.Show(MyCi.ToString());
怎么随机出来的数有80%是重复。
for (int x = 0; x < 300; x++)
{
Random Rand = new Random();
MyCi.Append(Rand.Next(0,1000 + " ");
} MessageBox.Show(MyCi.ToString());
怎么随机出来的数有80%是重复。
Random Rand = new Random();
for (int x = 0; x < 300; x++)
{
MyCi.Append(Rand.Next(0,1000).ToString() + " ");
}MessageBox.Show(MyCi.ToString());
for (int x = 0; x < 300; x++)
{
Random Rand = new Random(x);
MyCi.Append(Rand.Next(0,1000 + " ");
} MessageBox.Show(MyCi.ToString());
搞定了,还是把分给你。