BWT by 51b

strcmp();char s[99][99],t[99];n;main(i){for(;gets(t);puts("")){bcopy(t,t+n,n=strlen(t));98[*s]=1;for(i=n;i--;)bcopy(t+i,s[i],n);qsort(s,n,99,strcmp);for(i=n;i--;s[i][98]=0)s[i][98]&&printf("%d ",i);for(i=0;i<n;)putchar(s[i++][n-1]);}}

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

download

return to the top page