for(<>){$i=-1;/./;$c=$&;s/$c/++$i?():()/eg;\x0d printf"%0.6f\n",$i/($i-2+length)}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page