编程介的小学生 2017-08-30 12:19 采纳率: 20.5%
浏览 720
已采纳

Decorated A+B

t is really amazing to get an "A + B Problem" in a real programming contest, so you'd better get started from this one. But don't hurry, we have to deal with numbers given as bitmap array. The bitmap array of each digit is an 8x8 matrix, picturing the shape of the digit. The internal of the digit will be marked by an 'X', and the background will be spaces, as showed in the following table.

0 1 2 3 4 5 6 7 8 9 +
XXXX

XX XX
XX XX
XX XX
XX XX
XX XX
XX XX
XXXX

XX

XXXX

XX

XX

XX

XX

XX

XXXXXX
XXXX

XX XX
XX XX
XX
XX

XX

XX

XXXXXX
XXXX

X XX
XX
XXX

XX
XX
X XX
XXXX

XX

XXX

XXX

X XX

X XX

XXXXXX
XX

XXXXX
XXXXX
XX

XXXX

X XX
XX
XX
X XX
XXXX

XXXX
XX

XX

XXXXX

XX XX
XX XX
XX XX
XXXX

XXXXXX
X XX
XX
XX

XX

XX

XX

XX

XXXX

XX XX
XX XX
XXXX

XX XX
XX XX
XX XX
XXXX

XXXX

XX XX
XX XX
XX XX
XXXXX
XX
XX

XXXX

X

X

X

XXXXXXX
X

X

X

Input
The input file consists of several test cases. The first line of the input will be one integer N (0 < N <= 10), representing the number of test cases. Each test consists of exact 8 (eight) lines, which is the "A + B" problem. The bitmap array will be used to display each digit of A and B. Because the problem author is careless when preparing the input data, extraneous spaces may be (but not necessarily) inserted around each digit, and the trailing spaces at the end of the line may be removed by his (may be "her") editor. However, it is guaranteed that the A and B will be nonnegative integers less than 10000, and if any spaces are inserted around the digit, each line of the input will have the same number of spaces inserted at the same column. A and B will be separated by the "+" character. There will be a blank line between consecutive test cases.

Output
For each test case, output the result of A + B, using the given bitmap array. Please do NOT add any extraneous spaces around the digit, and the trailing spaces should be kept.

Separate two consecutive test cases with a blank line, but Do NOT output an extra blank line after the last one.

Sample Input
1
XX XXXXX
XXXX X XX

XX X XXXX

XX X X XX
XX XXXXXXX XX
XX X XX
XX X X XX
XXXXXX X XXXX

Sample Output
XXXX
XX

XX

XXXXX

XX XX
XX XX
XX XX
XXXX

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-09-14 16:19
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突