Random r = new Random((int)DateTime.Now.Ticks); var list = Enumerable.Range(0, 9).ToList(); list.Sort((x, y) => r.Next(-1, 1)); list.ForEach(x => Console.Write(x + "\t")); Console.Read();
Random r = new Random((int)DateTime.Now.Ticks); var list = Enumerable.Range(0, 9).ToList(); list.Sort((x, y) => r.Next(-1, 1)); list.ForEach(x => Console.Write(x + "\t")); Console.Read();
转载于:https://www.cnblogs.com/xinxinzhihuo/p/7714677.html