编程介的小学生 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 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler