How do I calculate how many "1" in a 2-based number

xiaoxiao2021-03-06  74

INT Countone (DWORD UDWNUMBER) {Int iCount = 0;

For (iCount = 0; 0! = udwnumber; iCount ) {udwnumber & = (udwnumber - 1);}

Return iCount;}

转载请注明原文地址:https://www.9cbs.com/read-108754.html

New Post(0)