PE001. Add all the natural numbers below one thousand that are multiples of 3 or
时间:2011-03-08 来源:raysuid
class PE001
{
static void Main(string[] args)
{
var result = Enumerable.Range(1, 999).
Where(i=>i%3==0 || i%5==0).
Aggregate((sum, i) => sum + i);
Console.WriteLine(result);
}
}
相关阅读 更多 +