附运行代码:
#include"bits/stdc++.h" using namespace std; int f(int a, int b) { return (~(~(~(a&b)&a)&~(b&~(b&a)))); } int main() { int cnt = 0; for (int i = -100; i < 100; i++) { for (int j = -100; j < 100; j++) { if (f(i, j) != (i ^ j)) { cnt++; } } } cout << cnt << endl; return 0; }