Skip to content

Instantly share code, notes, and snippets.

@hnw
Created January 1, 2014 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hnw/8208571 to your computer and use it in GitHub Desktop.
Save hnw/8208571 to your computer and use it in GitHub Desktop.
using System;
using System.Linq;
using System.Collections.Generic;
class Prob1
{
static void Main()
{
IEnumerable<int> nums =
from num in Enumerable.Range(1, 1000-1)
where num % 3 == 0 || num % 5 == 0
select num;
System.Console.WriteLine(nums.Sum());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment