Mars wrote:
> I don't know whether the inputs are all numbers or all strings...
> if they are numbers, they are sorted as numbers,
> if they are strings, they are sorted as strings....
>
>
> e.g.
>
> input : 9 12 2 4
> output : 2 4 9 12
>
> input : orange Banana
> ouput : Banana orange
You might find
http://sourcefrog.net/projects/natsort/
helpful. (Yes, that's "frog," not "forge.") Last
time I looked, the C implementation had several
occurrences of the "pass a plain `char' to a <ctype.h>
function" error, but those are easily repaired.
--