编程介的小学生 2019-06-05 21:11 采纳率: 20.5%
浏览 298

根据每个图案,打印由相应字符组成的行,这个字符生成图用C语言的程序编写代码的方式如何实现的

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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 ELGamal和paillier计算效率谁快?
    • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
    • ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
    • ¥15 Arcgis相交分析无法绘制一个或多个图形
    • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
    • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
    • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
    • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
    • ¥30 3天&7天&&15天&销量如何统计同一行
    • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码