题解 | 【模板】位运算Ⅰ ‖ 整体与、或、异或
【模板】位运算Ⅰ ‖ 整体与、或、异或
https://www.nowcoder.com/practice/cf1aea70e6e646b48b1c5fd2705c624e
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int k;
cin>>k;
while(k--){
int x,y;
cin>>x>>y;
cout<<(x|y)<<" "<<(x&y)<<" "<<(x^y)<<endl;
}
}

查看3道真题和解析