Start: Mar, 06, 2018 09:46:00
计算机161 算法分析与设计 第一次实验课作业(吴银杰、张凯庆)
End: Mar, 10, 2018 10:00:00
Time elapsed:
Time remaining:

Problem_ID: E
Result: Accepted
Time: 7ms
Memory: 1712kB
Author: 2017212212283
In contest: 1141

#include <iostream>
#include <cstdio>

using namespace std;
int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		long long n;
		int m,k;
		scanf("%x",&n);
		scanf("%d%d",&m,&k);
		int c=0;
		for(int i=0;i<32-m;i++)
		{
			k<<=1;
			c<<=1;
			c+=1;
		}
		n=n&c;
		n=n|k;
		printf("%08x\n",n);
	}
	return 0;
}