Sort-a-number. Sorta
Haskell 106

t=10;d=divMod;s z|z&lt;w z=s$w z|t&gt;0=z
w x|x&lt;t=x|y&gt;z=(q*t+y)*t+z|t&gt;0=y+t*(w v)where{(v,y)=d x t;(q,z)=d v t}


example:

ghci&gt; s 502010406072952146729521467295214672952146729
999997777766666555554444422222222221111100000


An answer that doesn't dodge the question.

An explanation was requested, here it is ungolfed. It's a very inefficient bubble sort.

-- t=10 - alias for 10. d=divMod - alias for divMod.
-- The alias for '10' turns out to be unnecessary; inlining it
-- and using '1&gt;0' for True has the same character count. It's
-- a relic of earlier versions of the code.

-- 's': if no digits need swapped, return the number,
-- otherwise return 's' applied to the number with
-- that pair of digits swapped.
sort z=
  let temp=sort_pair z
  -- because we are sorting in descending order,
  -- sorting a pair of digits always increases the number.
  -- testing &gt; costs one less char than ==.
  if z&lt;temp then
    -- golfed version uses guards instead of if/else to save space.
    -- t&gt;0 is '10 &gt; 0', which is 'True', in fewer chars.
    sort temp
  else
    z
-- 'w': recursively swap one pair of out of order digits, or
-- return the original number if no pairs needed swapped.
sort_pair x=
  -- haskell does the assignments below lazily, they aren't
  -- calculated unless I use them. 'divMod' lets me do this
  -- with fewer chars.
  let y = x `mod` 10 -- last digit
      v = x `div` 10 -- all but last digit
      z = v `mod` 10 -- second last digit
      q = v `div` 10 -- all but last 2 digits
  in
  if x &lt; 10 then
    x
  else if y &gt; z then
    -- last 2 digits are out of order. swap them &amp; return
    -- This is rearranged using Horner's method to save space
    -- http://en.wikipedia.org/wiki/Horner%27s_method
    -- ... although it turns out not to save anything, it's a relic.
    (q * 10 + y)*10 + z
  else
    -- last digit is ok, so try sort_pair on remaining digits
    let temp = sort_pair v in
    -- put last digit back on the end and return
    -- having the bracketed expression last here
    -- let me remove a space before 'where'
    y+(10*temp)


Shorter answers exist in Haskell, equivalent to some of the others posted, eg:

import Data.List;s=read.sort.show::Integer-&gt;Integer


... scores 52+20=72, or this, scoring 45+20=65:

import Data.List;main=interact(reverse.sort)


... but the spirit of the question - no arrays, strings, or characters - is more interesting.