Skip to main content
6 of 10
deleted 4 characters in body
syb0rg
  • 1.1k
  • 7
  • 23

C - 80 characters, 80 points

c(*a,*b){return a-b;}main(int a,char**b){b++;qsort(*b,strlen(*b),1,c);puts(*b);}

You might wonder how I get this to work without any headers. Simple, compile with:

gcc -include stdio.h stdlib.h string.h test.c -o test --std=gnu11 -Wall -g -O3

Un-golfed:

#include <stdio.h> 
#include <stdlib.h>
#include <string.h>

c(*a, *b)
{
    return a-b;
}

main(int a, char **b)
{
    b++;
    qsort(*b, strlen(*b), sizeof(char), c);  // sizeof(char) is guaranteed to be 1 by standards
    puts(*b);
}

Test run:

$ ./test 132815
112358
$ ./test 423791
123479
$
syb0rg
  • 1.1k
  • 7
  • 23