求助位运算
查看原帖
求助位运算
142549
hbhz_zcy楼主2021/6/24 13:53

位运算码

#include<iostream>
#include<cstdio>
#define LL long long
using namespace std;
int main(){
	LL a;
	scanf("%lld",&a);
	printf("%lld",a>>16+(a&((1<<16)-1))<<16);
	return 0;
}

混合

#include<iostream>
#include<cstdio>
#define LL long long
using namespace std;
const LL d=65536;
int main(){
	LL a;
	scanf("%lld",&a);
	printf("%lld",a>>16+(a%d)<<16);
	return 0;
}

纯普通运算:(略)
结果只有普通运算能过,为什么?

2021/6/24 13:53
加载中...