测试php计算1-500000中有多少个质数耗时脚本
]#vim testphp.php
<?php
$n = 0;
$start = 1;
$end = 500000;
for($num = $start; $num <= $end; $num++) {
if ( $num == 1 ) continue;
for ($i = 2; $i <= sqrt($num); $i++) {
if ($n...
原创
2018-08-06 11:51:18 ·
215 阅读 ·
1 评论