solve problem 5

This commit is contained in:
Colin McMillen 2020-11-17 14:47:16 -05:00
parent ea6859a54b
commit 30936fa435

View File

@ -97,8 +97,21 @@ namespace Euler {
return largest; 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) { static void Main(string[] args) {
WriteLine(Problem4()); WriteLine(Problem5());
} }
} }
} }