#include//n 的第i位替换为m的第i位using namespace std;int bitManipulation1(int n, int m, int i) { return ((m>>i)&1) == 1? (n|(1< > t; while (t--) { cin >> n >> m >> i; cout << bitManipulation1(n, m, i) << endl; } return 0;}
#include// n的第i位取反using namespace std;int bitManipulation2(int n, int i) { return (n>>i)&1 ==1? (n&(~(1< > t; while (t--) { cin >> n >> i; cout << bitManipulation2(n, i) << endl; } return 0;}
#include//左边i位取反using namespace std;int bitManipulation3(int n, int i) { return ((~0)<<(32-i))^n; }int main() { int t, n, i; cin >> t; while (t--) { cin >> n >> i; cout << bitManipulation3(n, i) << endl; } return 0;}