Finden Sie, ob Element Kräfte von 2 ist
powers of 2
Better Boar
powers of 2
/** Check if a number is a power of 2 or not.
* IF n is power of 2, return 1, else return 0.
*/
int powerOfTwo(int n)
{
return n && (!(n & (n-1)));
}