diff --git a/Program.cs b/Program.cs index d5cfc8b..2238fc5 100644 --- a/Program.cs +++ b/Program.cs @@ -97,8 +97,21 @@ namespace Euler { return largest; } + static long Problem5() { + for (long test = 20; ; test += 20) { + for (int i = 2; i <= 20; i++) { + if (test % i != 0) { + break; + } + if (i == 20) { + return test; + } + } + } + } + static void Main(string[] args) { - WriteLine(Problem4()); + WriteLine(Problem5()); } } } \ No newline at end of file