for(;n=readline();print(c?1+r:r))for(c=i=r='';n[i++];p=d)(d=+n.substr(-i,1)+c)>9?d=0:c=0,d>-1?r=d+r:(r='',c=p>4)
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page