题解 | 【模板】位运算Ⅱ ‖ 整体位移
【模板】位运算Ⅱ ‖ 整体位移
https://www.nowcoder.com/practice/3fb5a81504084bdeb86bf938f446250d?channelPut=tracker3
#include <bits/stdc++.h>
using namespace std;
using ll = long long ;
int main()
{
int t;
cin>>t;
while(t--)
{
int o;
cin>>o;
int x,p;
cin>>x>>p;
if(o==1){
cout<<(x<<p)<<endl;
}
else cout<<(x>>p)<<endl;
}
return 0;
}
查看14道真题和解析
