6 (5 is still calculating)
This commit is contained in:
parent
87526928ec
commit
7b6f0aeedb
14
euler6.php
Normal file
14
euler6.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
/*
|
||||
* Gnieark's anwser to euler problem 6
|
||||
* https://projecteuler.net/problem=6
|
||||
*/
|
||||
$sumOfTheSquares=0;
|
||||
for($i=1;$i<101;$i++){
|
||||
$sumOfTheSquares+=pow($i,2);
|
||||
}
|
||||
$sum=0;
|
||||
for($i=1;$i<101;$i++){
|
||||
$sum+=$i;
|
||||
}
|
||||
echo pow($sum,2) - $sumOfTheSquares;
|
Loading…
Reference in New Issue
Block a user