Sort by Length for OCaml Golf Competition by msk

p;c(a,b){p=strlen(b)-strlen(a)?:strcmp(b,a);}i,s[500][5];main(){for(;gets(s+i)?qsort(s,++i,20,c):puts(--i+s)*i;);}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page