Amazon | Onsite | checks source line contains all the words in the sample line
Anonymous User
205

We have two input files a and b and each file is a set of lines with random words.
write a c++ program that for each line in a file checks which lines in b file.
constains all the words in the sample line.
The program output will be a file containing the matched lines from
b and the ordinal of all the matching line in a.
E.g.
Supose a contains the following lines:
Line 0: one two three four five
Line 1: five three one ten
Line 2: eleven twelve three four two twenty
Line 3: fourteen two
Line 4: three ten twenty six seven
Line 5: seven nine one two
Line 6: four twelve one five three two

Line 0: twelve three four
Line 1: five four two
Line 2: three twentyone

The output file would be:
0 2 twelve three four
1 0 five four two

Comments (4)