Hangul resyllabification by inaniwa

#define P *p++=128|63&a
#define Q a?P>>12|96,P>>6,P:0,a=p[2]&63|p[1]+128<<6|*p+32<<12
char*p;a;main(b,s){for(;p=gets(s);a=!puts())Q,a-=b=(a-44032)%28,Q,a+=((b<9?b/2+b/8:b-9-22/b)-(a-44032)/588)*588,Q;}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page