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

Problem I. 195. (October 2008)

I. 195. When using a satellite navigation system with touchscreen, it is enough to enter only the first few characters of the name of the destination, and the computer automatically displays the next optional characters. A character is optional, if there is (at least one) destination in the database whose name begins with the string entered by the user so far together with the optional character. When typing a character, the computer also gives the number of matches, that is, the number of destinations whose name begins with the characters entered so far. This number is displayed next to the input field.

Write a program that simulates such a satellite navigation system. The input file (given as the first command line argument to your program) contains a list of possible destinations. You can use the sample file telepules.txt for your solution. Your program should use the standard output. The output after entering a character should contain the list of optional characters and the number of matches. It should be possible for the user to enter only optional characters. Your program should stop if ESC is pressed.

Lowercase and uppercase letters are not distinguished, and accents should also be ignored, so, for example, Ó, ö, Ő and o are all displayed and treated as o.

Example: ÁBRA

The source code of your program (i195.pas, i195.cpp, ...) together with a short documentation (i195.txt, i195.pdf, ...) should be submitted, also containing a brief description of your solution and the name of the developer environment to use for compiling.

(10 pont)

Deadline expired on November 17, 2008.


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

Megoldásokról:

Sok jól működő megoldás érkezett. Tipikus hiba, hogy a feladatkiírásban szereplő A program parancssori argumentuma legyen a településneveket tartalmazó adatállomány neve. mondatot néhány versenyző nem vette komolyan és az adatállomány név a kódban elrejtve szerepelt. Ez a javítást és tesztelést nehezíti. Az ékezetek használata nehézséget jelentett.

Mintamegoldásként Nagy Miklós 10. osztályos, győri versenyző munkáját közöljük ( I195.PAS)


Statistics:

17 students sent a solution.
10 points:Barta 111 János, Fehér Péter, Horváth 135 Loránd, Kővágó Zoltán, Molnár Gábor, Nagy 111 Miklós, Pap 999 Dávid, Uray Marcell János.
9 points:Tóth Szabolcs.
8 points:2 students.
7 points:4 students.
6 points:1 student.
2 points:1 student.

Problems in Information Technology of KöMaL, October 2008