"Ton Hospel" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
af4hqk$ppf$[EMAIL PROTECTED]">news:af4hqk$ppf$[EMAIL PROTECTED]...
> What can this list do ? Can you find 35 ? 32 ? even lower ?
Don't know about the list, but this is the shortest I could go within five
minutes (44). I bet many of you can find lower scores in less time. :)
$n=<>;print+(sort{abs$n-$a<=>abs$n-$b}<>)[0]
Steffen
--
@n=(544290696690,305106661574,116357),$b=16,@c=' ,JPacehklnorstu'=~
/./g;for$n(@n){map{$h=int$n/$b**$_;$n-=$b**$_*$h;$c[@c]=$h}c(0..9);
push@p,map{$c[$_]}@c[c($b..$#c)];$#c=$b-1}print@p;sub'c{reverse @_}