Mercurial > repo
annotate letersort @ 6187:980856e46a48
<mroman> echo "#!/bin/sh" > bin/downvote
author | HackBot |
---|---|
date | Thu, 05 Nov 2015 12:38:50 +0000 |
parents | a5ef8d072826 |
children |
rev | line source |
---|---|
5797
44ea2309c270
<enor> ` sed -i \'1i#include <stdio.h>\' letersort
HackBot
parents:
5795
diff
changeset
|
1 #include <stdio.h> |
5799
a5ef8d072826
<enor> ` sed -i \'s/\\*s-\\*c/\\*c-\\*s/\' letersort
HackBot
parents:
5797
diff
changeset
|
2 int compare(char *s,char *c){return*c-*s;}int main(){char w[40];int c,i=0;while( |
5794
4b799bff0ffd
<enor> ` cat >>letersort <<<\'1){c=getchar();if(c<=32||c==EOF){qsort(w,i,1,compare);w[i]=0;printf("%s",w);if(c\'
HackBot
parents:
5793
diff
changeset
|
3 1){c=getchar();if(c<=32||c==EOF){qsort(w,i,1,compare);w[i]=0;printf("%s",w);if(c |
5795
2c18109d67c8
<enor> ` cat >>letersort <<<\'==EOF)break;putchar(c);i=0;}else{w[i++]=c;}}}\'
HackBot
parents:
5794
diff
changeset
|
4 ==EOF)break;putchar(c);i=0;}else{w[i++]=c;}}} |