happy number by SeeNoEvil

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

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

download

return to the top page