一个数的二进制中有多少个1

xiaoxiao2021-02-28  38

int bit(unsigned int x) {     int c = 0;     while( x )     {         c++;         x = (x & (x - 1));     }     return c; }
转载请注明原文地址: https://www.6miu.com/read-2614144.html

最新回复(0)