1804.cpp

来自「这是哈尔滨工业大学acmOJ的源代码」· C++ 代码 · 共 24 行

CPP
24
字号
/*  This Code is Submitted by wywcgs for Problem 1804 on 2006-02-25 at 19:17:15 */ 
#include <cstdio>

typedef unsigned int uint;

int main()
{
	uint code[10];
	int i, j, t, T;
	
	scanf("%d", &T);
	for(t = 0; t < T; t++) {
		for(i = 0; i < 9; i++) scanf("%x", &code[i]);
		uint key = 0; code[9] = 0;
		for(i = 0; i < 32; i++) {
			for(j = 0; j < 10; j++) key ^= code[j]&(1<<i);
			for(j = 0; j < 8; j++) code[9] += (key^code[j])&(1<<i);
		}
		printf("%x\n", key);
	}
	
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?