Sort primes from list to a list: Difference between revisions

Added XPL0 example.
(→‎{{header|Raku}}: Add a Raku example)
(Added XPL0 example.)
Line 71:
103
done...
</pre>
 
=={{header|XPL0}}==
<lang XPL0>include xpllib;
int Primes, Smallest, I, SI;
def Len=9, Inf=1000;
[Primes:= [2,43,81,122,63,13,7,95,103];
repeat Smallest:= Inf;
for I:= 0 to Len-1 do
if Primes(I) < Smallest then
[Smallest:= Primes(I); SI:= I];
Primes(SI):= Inf; \cross off
if IsPrime(Smallest) then
[IntOut(0, Smallest); ChOut(0, ^ )];
until Smallest = Inf;
]</lang>
 
{{out}}
<pre>
2 7 13 43 103
</pre>
772

edits