int[] all = new int[] { 1,2,4,7,8,9 };
for (int h = 0, j = 0, k = 0; h < ra.Length; h++)
{
System.Random rand = new Random(DateTime.Now.Millisecond);
j = rand.Next(h, all.Length);
k = all[j];
all[j] = all[h];
all[h] = k;
}
//然後取這個被隨機打亂的數組中的第壹位或最後壹位,把剩下的做成下壹個數組,繼續打亂,繼續選取即可