happy number by SeeEvilRedBalloon

n,s,v,d;main(){for(n=0;n<2e3;){v=++n;while(v>4){for(s=0;v;){d=v%10;s+=d*d;v/=10;}v=s;}if(v<2)printf("%d\n",n);}}

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

download

return to the top page