You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
187 B
PHTML
12 lines
187 B
PHTML
9 years ago
|
<?php
|
||
|
/*
|
||
|
* Gnieark's anwser to euler problem 20
|
||
|
* https://projecteuler.net/problem=20
|
||
|
*/
|
||
|
|
||
|
$digits=str_split(gmp_fact(100));
|
||
|
$sum=0;
|
||
|
foreach($digits as $digit)
|
||
|
$sum+=$digit;
|
||
|
|
||
|
echo $sum;
|