Created
May 20, 2016 10:24
-
-
Save Shibe/bc4af65fd98239f043b8eba97cea5075 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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