Help make the last task in Pascal, or at least tell me how it can be done. Condition:
In the text file input.txt recorded Russian multi-line text. Find in the text words containing at least three letters from the first word of the text, write them in capital letters and indicate the letters found after each such word in brackets. The resulting text is written to the file output.txt. All text, except for the words found, must remain unchanged, including punctuation marks.
I was told that approximately it is done this way: the input file is read character by character, if the character is in the alphabet (Russian letters + punctuation), then this character is immediately written to the output file. At the same time, along the way, it is necessary to select words to check for compliance with the condition, and in the brackets after the desired word, write the matched letters). The main problem is that when reading character by character I do not even know how to select the letters from the first word. Therefore, I read every line of text, parse it into words that I add to the array, etc. The program seems to give some kind of result, but I very much doubt its correctness. Here is my program: http://ideone.com/eIQIqO Help make it the way I was recommended. I think this is the most universal way, such a program will process any text with lines of any length.