POJ 3748 位操作 题目链接:http://poj.org/problem?id=3748
题目分析:无难点,注意要用long long,输入输出时稍加注意即可。
code:
#include<stdio.h>
int main()
{
long long n,x,y,temp;
scanf("%llx,%lld,%lld",&n,&x,&y);
temp=1;
while(x--)temp<<=1;
if(n&temp)n-=temp;
temp=1;
while(y--)temp<<=1;
n|=temp;
temp>>=1;
n|=temp;
temp>>=1;
if(n&temp)n-=temp;
printf("%llx\n",n);
return 0;
}
PS:略水,再水最后一发正式开始