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

Problem I. 130. (April 2006)

I. 130. Write your program to find anagrams in a given text. An anagram of a word is formed by rearranging its letters arbitrarily, as in earth and heart.

The name of the input and output text file is specified as the first and second parameter: for example, if we want to collect all anagrams of text.txt into anagrams.txt, then the following command is issued

i130.exe text.txt anagrams.txt

The input file contains at most 1000 words in some lines and separated by spaces. Each word has at most 30 letters without any special characters. Lower and upper case letters are considered the same.

Each line of the output file should contain a group of anagrams separated by spaces. The words are listed in alphabetic order in each group, and groups containing more words come first.

See the example.

The source code (i130.pas, i130.cpp, ...) is to be submitted.

(10 pont)

Deadline expired on May 15, 2006.

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





13 students sent a solution.
10 points:Balambér Dávid, Gilián Zoltán, Györök Péter, Kiss Dániel Miklós, Ócsvári Ádám, Ozsvárt László, Szoldatics András, Véges Márton.
8 points:2 students.
7 points:1 student.
5 points:1 student.
0 point:1 student.

Problems in Information Technology of KöMaL, April 2006