摘要:
static bool IsPrime(int n) { return Enumerable.Range(2, (int)Math.Sqrt(n) - 1).All(i => n % i != 0); }相关知识一:Enumerable.Range MethodGenerates a sequence of integral numbers within a specified range.Namespace: System.LinqAssembly: System.Core (in System.Core.dll)public... 阅读全文
posted @ 2012-11-20 11:12
xulonghua219
阅读(259)
评论(0)
推荐(0)

浙公网安备 33010602011771号