二进制
//二进制
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,m;
int a[N],b[N];
int main(){
int c=5;
cout<<(5^6)<<endl; //3
cout<<(5&6)<<endl; //4
cout<<(5|6)<<endl; //7
cout<<(~5)<<endl; //-6
cout<<(-1/4)<<endl; //0
cout<<(1<<4)<<endl; //16
cout<<(13>>2)<<endl; //3
cout<<((-1)>>2)<<endl; //-1
cout<<(8 & 7)<<endl; //判断 a是否是2^k
cout<<(6&-6)<<' '<<(8 & -8)<<' '<<(7 & -7)<<endl; //2,8,1,取该数最后一个 1
cout<<(a&~(1<<b))<<endl;//把第 b位变为 0
cout<<(23|(1<<b))<<endl;//把第 b位变为 1
cout<<((77>>b)&1)<<endl;
cout<<((31>>b)&1)<<endl;//判断第 b位是不是 1
cout<<(31^(1<<4))<<endl;//把第 b位取反
return 0;
}