作者:妈妈说称号长的人很牛也 | 来源:互联网 | 2018-04-24 12:33
<$max):$boofalse;foreach($arras$value):if($ss%$value0):$bootrue;break;endif;endforeach;if(!$boo):echo$ss."";$arr[count($arr)]$ss;endif;$ss++;endwhile;echo"";?>
编程程序php网页
$ss = 2;
$max = 1000;
$arr = array();
echo $max."以内的素数为:";
while ($ss <$max):
$boo = false;
foreach ($arr as $value):
if ($ss % $value == 0):
$boo = true;
break;
endif;
endforeach;
if (!$boo):
echo $ss." ";
$arr[count($arr)] = $ss;
endif;
$ss++;
endwhile;
echo "
";
?>