solve problem 5
This commit is contained in:
parent
ea6859a54b
commit
30936fa435
15
Program.cs
15
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());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user