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