Mercurial > repo
changeset 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 | 089afdbc6e06 |
files | letersort |
diffstat | 1 files changed, 1 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/letersort Sun Jul 05 00:48:43 2015 +0000 +++ b/letersort Sun Jul 05 00:49:04 2015 +0000 @@ -1,2 +1,3 @@ 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;}}}