Count of circles in a number aka 2581 by inaniwa

while s=gets\x0d
  p s.tr('0-9','1000001021').split(//).map{|n|n.to_i}.inject{|a,b|a+b}\x0d
end\x0d

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

download

return to the top page