弱省高二老年划水选手在此!!!!!!!!(目前已退役)

Ryan_

Every thing that kills me makes me feel alive.

将二进制下的整数的前十六位与后十六位交换

#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
    unsigned long long x;
    cin>>x;
    cout<<((x&0x0000ffff)<<16|(x&0xffff0000)>>16)<<endl;
}

将左/右移的数取并集,不足16位则自动溢出

posted @ 2019-10-17 15:16  Ryan_zero  阅读(274)  评论(0编辑  收藏  举报