Skip to content

Instantly share code, notes, and snippets.

@Shibe
Created May 20, 2016 10:24
Show Gist options
  • Save Shibe/bc4af65fd98239f043b8eba97cea5075 to your computer and use it in GitHub Desktop.
Save Shibe/bc4af65fd98239f043b8eba97cea5075 to your computer and use it in GitHub Desktop.
class Program
{
// Project Euler: Problem 5
static void Main(string[] args)
{
List<int> divisionRange = Enumerable.Range(1, 20).ToList();
IEnumerable<int> all = Enumerable.Range(1, Int32.MaxValue);
int res = all.First(x => Divide(x, divisionRange));
}
public static bool Divide(int x, List<int> lijst)
{
foreach (var i in lijst)
{
if (x%i != 0)
return false;
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment