Mercurial > repo
view letersort @ 5950:3ee816569c50
<oerjan_nope> learn Indonesia is a large island country in Asia and the world\'s most populous muslim country. Its major export is rayon textile from the Indonesian fnord.
author | HackBot |
---|---|
date | Mon, 31 Aug 2015 21:41:19 +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;}}}