Mercurial > repo
view letersort @ 6039:637863599c36
<b_jonas> le/rn ayacc/ayacc is ais523\'s yacc parser generator implementation, get it from http://nethack4.org/media/alex/ayacc/ayacc.pl
author | HackBot |
---|---|
date | Wed, 30 Sep 2015 09:06:00 +0000 |
parents | a5ef8d072826 |
children |
line wrap: on
line source
#include <stdio.h> int compare(char *s,char *c){return*c-*s;}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;}}}