Problem I. 160. (May 2007)
I. 160. One often finds incorrect HTML pages on the web, with incomplete commands as a typical error. Your program should check whether every <command> in the HTML file has a closing </command> tag. You do not need to worry about whether it is a valid HTML command, or if it does not require a closing tag at all (e.g. <img src...>) - you should simply examine every HTML command pair. However, the program should issue a warning if a closing sequence has a wrong order (e.g. <b><i></b></i>). The name of the file to be checked is given as a command line parameter (e.g. i160.exe ANYTHING.HTML). Each line should be examined. If a <command> </command> pair does not have its opening or closing tag, you should give a warning. These messages should be stored in the messages.txt file created by your program and containing the missing opening or closing tags and the line numbers of the original file where they occurred.
The source code of your program (i160.pas, i160.cpp, ...) should be submitted.
Deadline expired on 15 June 2007.
Sorry, the solution is available only in Hungarian. Google translation
Balambér Dávid (Budapest, Fazekas Mihály Főv. Gyak. Gimn.) megoldása: