网摘 |  收藏 | 
摘要: 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 阅读(251) 评论(0) 推荐(0) 编辑