编程介的小学生 2019-08-15 22:21 采纳率: 20.5%
浏览 75

C语言Maple is a good techer

Problem Description
Recently, Mr. Maple feels it more and more boring to check the students' homework, especially those with multiple choice questions. Then he emerges an idea of using computer to help him check the answers. So that Mr. Maple needs a program, which can recognize what letters the students filled in after the answer sheets are scanned into the computer.
So far, the answer sheets have been transfered into square-like patterns (refer to the sample), in which ‘X’ presents the painted pixel, and ‘.’ presents blank. It’s your turn to write a program for recognition. Go!

  • Some details about the patterns: 1) The size of patterns is always 16 * 16. 2) Each pattern can have one and only one character. 3) The character belongs to {A, B, C, D}. 4) The written character won’t be too small. 5) The character may be distorted or rotated (a little). 6) Redundant pixels would turn up in a few cases. 7) Necessary pixels would be missing in a few cases. 8) It is guaranteed that all the test data can be easily judged by eye.

Input
The first line contains the number T of testcases (1 ≤ T ≤ 50). Then T patterns below.
Note that there is a blank line between the patterns.

Output
For each pattern print a line consisting of the corresponding character.

Sample Input
3
................
........X.......
.......XX.......
......X..X......
.....XX..X......
.....X...X......
....XX...X......
....X....X......
...X.....XX.....
...XXXXXXXXXX...
..XX......XX....
..XX.......X....
..XX.......XX...
..XX........X...
.XXX.X.......XX.
................

..X.............
................
......XXXXXX....
............X...
.....XX......XX.
.....X.......XXX
....XX........X.
....X.........X.
...X.....XX..X..
...XXXXXXXXX....
...X......XX.X..
..X...........X.
..X...........X.
..X.........XX..
.XXXXXXXXXXX....
................

................
................
................
.........XXX....
......X.........
...XX...........
.XX.............
X...............
X...............
.XX.............
.XX.........X...
...XX.XXXXXXX...
.....XXXXXXX....
................
................
................

Sample Output
A
B
C

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥35 平滑拟合曲线该如何生成
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 自己瞎改改,结果现在又运行不了了
    • ¥15 链式存储应该如何解决
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站