User:Yeti: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 1: | Line 1: | ||
=AWK/Primes/FSOE= |
|||
==AWK/Primes/FSOE1== |
|||
FSOE1 needs a number:set mapping and expressing this in AWK would blow up the code too much. (Or shorter: Maybe later.) |
|||
==AWK/Primes/FSOE3== |
|||
<lang awk>BEGIN { |
|||
n=2 |
|||
while( n<100 ) { |
|||
if( n in L ) { |
|||
p=L[n] |
|||
del L[n] |
|||
} else { |
|||
p=n |
|||
printf n " " |
|||
} |
|||
npp=n+p |
|||
while( npp in L ) |
|||
npp=npp+p |
|||
L[npp]=p |
|||
n++ |
|||
} |
|||
print |
|||
}</lang> |
|||
{{out}} |
|||
<pre> |
|||
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 |
|||
</pre> |
|||
=Dc/Questions/DROP= |
=Dc/Questions/DROP= |
||
TODO Drop top of stack without side effects |
TODO Drop top of stack without side effects |