Network mask v2 by

a,b,c,d,i;z(int n){i=n&1;for(;n>>=1;i+=n&1);return i;}main(){while(scanf("%d.%d.%d.%d",&a,&b,&c,&d)>0)printf("%d\n",z(a)+z(b)+z(c)+z(d));}

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

download

return to the top page