#include <strings.h>
int ffs(int i);
#include <stdio.h>
#include <string.h>
int main()
{
int i[] = {1, 2, 4, 8, 16, 32, 64, 0};
int j;
for (j = 0; j < 8; j++)
printf ("%d : %d \n", i[j], ffs(i[j]));
return 0;
}
./ffs
1 : 1
2 : 2
4 : 3
8 : 4
16 : 5
32 : 6
64 : 7
0 : 0
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |