编程介的小学生 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
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面