日期:2014-05-18 浏览次数:20867 次
int[] numbers = new int[100]; for (int i = 0; i < 100; i++) numbers[i] = i; Random rd = new Random(); int index, realLength = numbers.Length, temp; for (int i = 0; i < 100; i++) { index = rd.Next(realLength); Response.Write(numbers[index] + "<br/>"); temp = numbers[index]; numbers[index] = numbers[realLength - 1]; numbers[realLength - 1] = temp; realLength--; }