Mercurial > repo
view letersort @ 5845:b7c3d318e0e6
<Jafet> ` echo $\'#!python\\ns=set()\\ntry:\\n while True:\\n l=raw_input()\\n if l not in s:\\n s.add(l)\\n print(l)\\nexcept IOError:\\n pass\' > bin/uniqs && chmod +x bin/uniqs
author | HackBot |
---|---|
date | Sat, 18 Jul 2015 10:25:33 +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;}}}