Given an MxN filled up cross word, write a program to print all the words present in the cross word. Cross word table is given as input in a text file that contains ‘0′ for a shaded square and any other valid alphabet [A-Z] for any other position. Each row is a line of text input. A word has to be at least 2 letters long. The program has to read in the input file, and then print out all the words present. Your program has to print the output in the following format: >i is the row and j is the column from which the word begins.
The input file would contain:
The output should contain:<1,6>:CONGRESS:Across
Note: The greyed out numbers are row/column number for reference. They are not part of either input or output. The filename of the input text file should be given as the command line argument to your program. The output should appear on STDOUT. Take care to remove all the debug messages before you submit your program.
6,157 Views |