You can read lines with
File.ReadAllLines()
which will give you an array of strings (lines).
You can split the line with
line.Split(' ')
where
line
is a line from the above array of lines and you are splitting on spaces, which will give you a array of words fro the lines.
You should be able to do what you want from there.
[Edit - my apologies for not seeing the c++]
For c++ see this for reading lines :
http://www.cplusplus.com/forum/beginner/74757/[
^]
and this for splitting :
http://stackoverflow.com/questions/5888022/split-string-by-single-spaces[
^]