Mathematical and Physical Journal
for High Schools
Issued by the MATFUND Foundation
 Already signed up? New to KöMaL?

# Problem I. 152. (February 2007)

I. 152. Write a program to recognize the following characters: see the Figure.

The file in.txt contains the characters to be recognized: white squares are encoded as 0's, while black squares as 1's. The input always contains letters of size 5×8, separated by two white columns. (There is no such white column before the first and after the last letter.) The input has more than one line, and every 8th line consists of entirely 0's as separators.

You should apply the following rules for recognition:

- If the input sign has a black dot at a certain position and some of the letters also have a black dot there, then the matching rate increases by 1.

- If the input sign has a black dot at a certain position and some of the letters do not have a black dot there, then the matching rate decreases by 1.

The input sign is identified as a certain letter, if the matching rate is at least 50% between the input and that letter. (Your output then is this letter.) If there are two candidates with equal matching rate, or the rate is less than 50%, your output should be a ?''. The output file out.txt should contain the recognized letters or the question marks without spaces.

For example, if the input sign is the following:

then

so this character is recognized as letter B''.

The source code of the program (i152.pas, i152.cpp, ) should be submitted.

(10 pont)

Deadline expired on March 19, 2007.

Sorry, the solution is available only in Hungarian. Google translation

Nagyon sok jó megoldás született, lássuk ezúttal Balambér Dávid /Budapest, Fazekas M. Főv. Gyak. Gimn./ programját: I152.PAS

### Statistics:

 18 students sent a solution. 10 points: Balambér Dávid, Biró János, Bőle Pál, Czigler András, Földes Imre, Gilián Zoltán, Gombos Gergely, Györök Péter, Kovács 129 Péter, Polgárfi Bálint, Póta Kristóf, Ridinger Tamás, Szoldatics András, Vincze János. 8 points: 3 students. 6 points: 1 student.

Problems in Information Technology of KöMaL, February 2007