Largest int from concatenated ints: Difference between revisions
Content added Content deleted
MaiconSoft (talk | contribs) (Added Delphi reference to Pascal code) |
(→{{header|Quackery}}: second method) |
||
Line 1,906: | Line 1,906: | ||
=={{header|Quackery}}== |
=={{header|Quackery}}== |
||
'''With a string of space separated sequences of digits:''' |
|||
<lang quackery>[ sortwith |
<lang quackery>[ sortwith |
||
[ 2dup swap join |
[ 2dup swap join |
||
Line 1,918: | Line 1,921: | ||
6054854654 |
6054854654 |
||
</pre> |
</pre> |
||
'''With a nest of numbers:''' |
|||
<lang quackery> [ number$ dip number$ join $->n drop ] is conc ( n n --> n ) |
|||
[ 2dup conc unrot swap conc < ] is conc> ( n n --> b ) |
|||
[ sortwith conc> |
|||
$ "" swap |
|||
witheach [ number$ join ] |
|||
$->n drop ] is task ( [ --> n ) |
|||
' [ [ 1 34 3 98 9 76 45 4 ] |
|||
[ 54 546 548 60 ] ] |
|||
witheach [ task echo cr ] </lang> |
|||
{{out}} |
|||
<pre>998764543431 |
|||
6054854654</pre> |
|||
=={{header|Racket}}== |
=={{header|Racket}}== |