Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- print "PHP\n";
- $startTime = microtime(true);
- $result = 0;
- for ($i=2; $i<10000; $i++) {
- $prime=true;
- for ($j=2; $j<$i; $j++) {
- if ($i%$j==0) {
- $prime=false;
- break;
- }
- }
- if($prime)
- $result++;
- }
- print $result."\n";
- print (microtime(true)-$startTime)." s\n\n";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment