view letersort @ 5795:2c18109d67c8

<enor> ` cat >>letersort <<<\'==EOF)break;putchar(c);i=0;}else{w[i++]=c;}}}\'
author HackBot
date Sun, 05 Jul 2015 00:49:04 +0000
parents 4b799bff0ffd
children 44ea2309c270
line wrap: on
line source

int compare(char *s,char *c){return*s-*c;}int main(){char w[40];int c,i=0;while(
1){c=getchar();if(c<=32||c==EOF){qsort(w,i,1,compare);w[i]=0;printf("%s",w);if(c
==EOF)break;putchar(c);i=0;}else{w[i++]=c;}}}