题解 | #两个整数二进制位不同个数#
两个整数二进制位不同个数
https://www.nowcoder.com/practice/16e48900851646c0b2c6cdef9d7ea051
#include <stdio.h> int main() { int a, b; while (scanf("%d %d", &a, &b) != EOF) { int c=0,j=0,i=1,count=0; c=a^b; for(j=0;j<32;j++) { if(((c>>j)&1)==1) count++; } printf("%d",count); } return 0; }