반응형
#include<stdio.h>
int c_bitcount(unsigned x)
/* author : kyoung chip jang date : descript: */ int main( int argc , char ** argv ) { int x = 1; x = x * ( 2 + 1 ); int i = c_bitcount( x ); printf("%d\n", i ); return 0; } int c_bitcount(unsigned x) { int b; for (b = 0; x != 0; x >>= 1) if (x & 01) b++; return b; }
반응형