Mercurial > repo
changeset 5797:44ea2309c270
<enor> ` sed -i \'1i#include <stdio.h>\' letersort
author | HackBot |
---|---|
date | Sun, 05 Jul 2015 00:53:08 +0000 |
parents | 089afdbc6e06 |
children | 1affecc6589d |
files | letersort |
diffstat | 1 files changed, 1 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/letersort Sun Jul 05 00:49:48 2015 +0000 +++ b/letersort Sun Jul 05 00:53:08 2015 +0000 @@ -1,3 +1,4 @@ +#include <stdio.h> 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;}}}