partition by parity by Fukuda

while(<>){$_!~/\n$/?$_.="\n":$_;$_%2==0?push@e,$_:push@o,$_}@s=sort{$a<=>$b}@e;@t=sort{$a<=>$b}@o;print@s,"\n",@t;

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

download

return to the top page