Collect and sort square numbers in ascending order from three lists: Difference between revisions

Content added Content deleted
No edit summary
(add RPL)
Line 604: Line 604:
done...
done...
</pre>
</pre>

=={{header|RPL}}==
≪ + + OBJ→ → <span style="color:green">'''n'''</span>
≪ { } 1 <span style="color:green">'''n'''</span> '''START'''
'''IF''' DUP √ FP '''THEN''' DROP '''ELSE''' + '''END NEXT'''
SORT
≫ ≫ '<span style="color:blue">'''GETSQ'''</span>' STO

{ 3 4 34 25 9 12 36 56 36 } { 2 8 81 169 34 55 76 49 7 } { 75 121 75 144 35 16 46 35 } <span style="color:blue">'''GETSQ''' </span>
'''Output:'''
<span style="color:grey"> 1:</span> { 4 9 16 25 36 36 49 81 121 144 169 }



=={{header|Ruby}}==
=={{header|Ruby}}==
Line 623: Line 635:
<pre>[4, 9, 16, 25, 36, 36, 49, 81, 121, 144, 169]
<pre>[4, 9, 16, 25, 36, 36, 49, 81, 121, 144, 169]
</pre>
</pre>

=={{header|Sidef}}==
=={{header|Sidef}}==
<syntaxhighlight lang="ruby">var lists = [
<syntaxhighlight lang="ruby">var lists = [