Created
October 21, 2013 15:31
-
-
Save kazua/7085834 to your computer and use it in GitHub Desktop.
Project Euler Problem 80(PHP)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%2080 | |
| //write kazua | |
| echo | |
| array_sum( | |
| array_map( | |
| function ($value) { | |
| return | |
| array_sum( | |
| str_split( | |
| substr( | |
| str_replace(".", "", ((string) $value)), | |
| 0, | |
| 100) | |
| ) | |
| ); | |
| }, | |
| array_filter( | |
| array_map( | |
| function ($value) { | |
| return bcsqrt($value, 100); | |
| }, | |
| range(1, 100) | |
| ), | |
| function ($value) { | |
| return (int) $value != (double) $value; | |
| } | |
| ) | |
| ) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment