日期:2014-05-18 浏览次数:20686 次
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Random r = new Random(Guid.NewGuid().GetHashCode()); var result = Enumerable.Range(0, 2500000).Select(x => r.Next()).Distinct().Take(2000000).ToArray(); Console.WriteLine("结果的前1000个:"); for (int i = 0; i < 200; i++) { Console.WriteLine(string.Join("\t", result.Skip(i * 5).Take(5).Select(x => x.ToString().PadLeft(10, ' ')))); } } } }