Sort primes from list to a list: Difference between revisions
added RPL
(Created Nim solution.) |
(added RPL) |
||
Line 655:
[2,7,13,43,103]
done...
</pre>
=={{header|RPL}}==
{{works with|HP|49}}
« SORT { }
1 PICK3 SIZE '''FOR''' j
OVER j GET
'''IF''' DUP ISPRIME? '''THEN''' + '''ELSE''' DROP '''END'''
'''NEXT''' NIP
» '<span style="color:blue">TASK</span>' STO
{2,43,81,122,63,13,7,95,103} <span style="color:blue">TASK</span>
{{out}}
<pre>1: { 2 7 13 43 103 }
</pre>
|