#!ruby -n def m s;1+[999,9,4,0,99,499,49][s[0]%87%7]end r=0 scan(/./){n=m$&;r+=n<m($')?-n:n} p r
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page