// portable code to count the number of bits#include <;stdio.h>
int count(unsigned int x)
{ int n = 0; while (x > 0) { x = x&;(x-1); n = n + 1; }return n;
}

| عنوان | پاسخ | بازدید | توسط |
| |
0 | 3000 | admin |
| |
0 | 1856 | admin |
| |
0 | 3906 | admin |
| |
0 | 2223 | admin |
| |
0 | 1998 | admin |
// portable code to count the number of bits#include <;stdio.h>
int count(unsigned int x)
{ int n = 0; while (x > 0) { x = x&;(x-1); n = n + 1; }return n;
}