Code Festival C Div and Add by ciel

x;d(n,r,i){for(;--i;)n%i==0&&r<(x=d(i,0,i))&&(r=x);for(;n;n/=10)r+=n%10;return r;}main(){for(;~scanf("%d",&x);)printf("%d\n",d(x,0,x));}

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

download

return to the top page