1338: 二进制加法

内存限制:128 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:10 通过:1

题目描述

二进制加法是一项非常简单的任务,与十进制数的加法非常相似。
与十进制数字一样,从右到左,一次一列地添加位(数字)。
与十进制加法不同,这一过程中几乎没有记忆
二进制位的加法规则:

0 + 0 = 0 

1 + 0 = 1 

0 + 1 = 1 

1 + 1 = 10 

1 + 1 + 1 = 11 



与十进制加法一样,当一列中的和是两位(两位数)数字时,最低有效数字被写入总和的一部分,最高有效数字被“进位”到下一个左列。

考虑以下示例:





The addition problem on the left did not require any bits to be carried, 

since the sum of bits in each column was either 1 or 0, not 10 or 11. 

In the other two problems, there definitely were bits to be carried, but the process of addition is still quite simple.


输入格式

The first line of input contains an integer N, (1 <= N <= 1000), which is the number of binary addition problems that follow. Each problem appears 

on a single line containing two binary values separated by a single space character. The maximum length of each binary value is 80 bits (binary digits). 

Note: The maximum length result could be 81 bits (binary digits).

输出格式

For each binary addition problem, print the problem number, a space, and the binary result of the addition. 

Extra leading zeroes must be omitted.



输入样例 复制

3
1001101 10010
1001001 11001
1000111 1010110

输出样例 复制

1 1011111
2 1100010
3 10011101