Thread Syntax highlighting (15 answers)
Opened by LanX at 2009-03-02 13:47

Gast Taulmarill
 2009-03-02 15:07
#38 #38
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use strict;
use warnings;

my @primes = qw/2 3 5 7/;

for my $i ( 10 .. 1_000_000 ) {
for my $j ( @primes ) {
if ( $j > sqrt $i ) {
push @primes, $i;
last;
}
next if $i % $j;
last unless $i % $j;
}
}

print "$_\n" for @primes;


Hier sollten dann auch die Zeilennummern Sinn machen.

View full thread Syntax highlighting