Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- long long a;
- int m,n,t1,t2;
- while(~scanf("%lld%d%d",&a,&m,&n)){
- t1 = ((a >> m)&1);
- t2 = ((a >> n)&1);
- a &= (~((1 << m) | (1 << n)));
- a |= (t1 << n);
- a |= (t2 << m);
- printf("%lld\n",a);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment