get quotient without division and multiplication

unsigned int NDivide3(unsigned int n) ... {
unsigned
intans=0,i,b;
while(n>3)...{
b
=n>>2;
ans
+=b;
n
=n^3+b;
}

if(3==n)return++ans;
elsereturnans;
}

你可能感兴趣的:(visio)