Sort by Length for OCaml Golf Competition by *yuko*

character*99s(999),c;do1 i=1,999;read(*,*,end=2),s(i)
do1 j=1,i;c=s(i);if(adjustr(c)>adjustr(s(j)))cycle;s(i)=s(j);1 s(j)=c
2 print'(a)',(trim(s(i)),i=1,i-1);end

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

download

return to the top page