Project Euler problem 5.

This commit is contained in:
sweatshirt0 2023-01-22 14:32:04 -05:00
parent 26e644bd53
commit c1d99b8220
1 changed files with 25 additions and 0 deletions

25
PE5.php Normal file
View File

@ -0,0 +1,25 @@
<?php
$c = 0;
$n = 1;
while ($c < 20) {
for ($i = 1; $i <= 20; $i++) {
if ($n % $i == 0) {
$c++;
} else {
$c = 0;
break;
}
}
if ($c == 20) {
echo $n . "\n";
break;
} else {
$n++;
}
}
?>