1.
int main() { int n = 0; int m = 0; scanf("%d %d", &m,&n); int count = 0; int i = 0; for (i = 0; i < 32; i++) { if (((m>>i) & 1) != ((n>>i) & 1)) { count++; } } printf("%d\n", count); return 0; }
2.
int main() { int count = 0; int m = 0; int n = 0; scanf("%d %d", &m, &n); int ret = m ^ n; while(ret) { ret = ret & (ret - 1); count++; } printf("%d\n", count); return 0; }